3

I'm running a multivariate gls model:

m <- gls(y ~ x + factor1 + factor2, cor = corPagel(1,phylogeny), weight= ~1/log(n))

I want to plot the results and I could get predicted values like this:

newdata <- data.frame(expand.grid( x = mean(x), factor1= unique(factor1), factor2 = unique(factor2)))

predvals <- predict(m,newdata)

Although two of the variables I want to plot are factors, and I want to get confidence intervals or standard errors for these predicted values.

Does anyone know how to do it?

Thanks in advance for your help! Cheers, Jasmine

Jasmine
  • 103
  • 2
  • 7
  • 1
    Any data to play with ? – dickoa Jan 24 '14 at 10:10
  • I think that's a question for stats.stackexchange.com (please flag the question and ask the moderators to migrate it, do not cross-post). Possibly you could use bootstrap? I'm not sure. – Roland Jan 24 '14 at 10:58
  • 1
    I solved the problem using the "AICcmodavg" package. `predictSE.gls (model, newdata, se.fit=T)`. It works perfectly! – Jasmine Feb 04 '14 at 08:45
  • But that's the fit interval, not the prediction interval. – jebyrnes Feb 07 '17 at 15:41

0 Answers0