Skip to content
Prev 118 / 7420 Next

nlme model specification

Matthew,

Zuur et al (2007) recommands that you first select a good random structure. In a next step you can refine the model by adding correlation structures. I don't think that you may compare f.gls with f.lme because both the random effect and the correlation structure are different (gls is like a lme without random effect.

So in a first step I would compare the models below.

gls(fixed = growth ~ diameter*vines)
lme(fixed = growth ~ diameter*vines, random = ~ 1 | tree.id)
lme(fixed = growth ~ diameter*vines, random = ~ yr | tree.id)
lme(fixed = growth ~ diameter*vines, random = ~ factor(yr) | tree.id) 

The last random effect needs a lot of parameters (45). But depending on the structure of the variance-covariance matrix of the random effect you might be able to simplify it to a pdDiag, pdCompSymm or pdIdent structure. Have a look at Pinheiro and Bates for more details on those structures.

Suppose ~ year | tree.id was the best random effect. Then i could compare

lme(fixed = growth ~ diameter*vines, random = ~ yr | tree.id)
lme(fixed = growth ~ diameter*vines, random = ~ yr | tree.id, correlation = corAR1(form = ~ yr|tree.id))
lme(fixed = growth ~ diameter*vines, random = ~ yr | tree.id, correlation = corARMA(form = ~ yr|tree.id, p = 0, q = 1))
...

HTH,

Thierry


----------------------------------------------------------------------------
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be 
www.inbo.be 

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: Landis, R Matthew [mailto:rlandis at middlebury.edu] 
Verzonden: vrijdag 23 mei 2008 20:40
Aan: ONKELINX, Thierry; Christian A. Parker; 'P?ter S?lymos'
CC: r-sig-ecology at r-project.org
Onderwerp: RE: [R-sig-eco] nlme model specification

Dear Thierry, Chris, Peter, and the list,

Based on these suggestions and some others, I realize now that tree id is clearly the grouping variable.  A couple people had mentioned in a previous letter that there is likely to be temporal autocorrelation within trees, and I am particularly interested in this aspect of the data, which prompted me to look into the autocorrelation structures described in Pinheiro and Bates.

I am still a little confused about the two different approaches for accounting for non-independence within trees among years (i.e. specifying tree.id as a random effect vs. specifying autocorrelation in the residuals.  I am currently considering these alternative models:

f.gls <- gls(growth ~ diameter*vines, corr = corAR1(form = ~ yr|tree.id)

f.lme <- lme(fixed = growth ~ diameter*vines, random = ~ 1 | tree.id)

f.lme.ar1 <- lme(fixed = growth ~ diameter*vines, random = ~ 1 | tree.id, correlation = corAR1(form = ~ yr | tree.id))

For f.gls, phi is 0.67, which pretty closely matches the value I determined empirically by correlating residuals from different years.
plot(ACF(f.gls)) also reveals highly signficant autocorrelation which decays smoothly with lag.  This approach is very appealing, because it closely matches what I see if I make a correlation matrix among years empirically from the residuals.

However, f.lme.ar1 also has significant correlation, and a lower AIC than f.gls (and f.lme).  But now phi is only 0.26, and plot(ACF(f.lme.ar1)) does not look like AR1, but is rather increasingly negative with longer lags.  I don't quite understand this change in phi, or the biological interpretation of the correlation structure.

So, even though f.gls has a higher AIC, I'd like to use that one because it seems more biologically interpretable.  Does this adequately account for the pseudoreplication across years, or do I really need that random effect of tree.id in there?

Again, many many thanks for all your help.  This makes a lot more sense to me now than it did.

Matt