[R-sig-ME] longitudinal analysis of nested samples

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Oct 17 10:20:19 CEST 2011


Dear Giancarlo,

You will need to have a look at your data. Since you claim that TR has 4 levels but the model output indicates only one (Number of obs: 560, groups: TR, 1).

The trees are nested within point. Therefore a more likely model is lmer(V ~ YR + (1|PT/TR), data=TREES) or lmer(V ~ YR + (1|PT) + (1|PT:TR), data=TREES) Both models are identical, the second is a bit more verbose but more clear. If the points are nested within transects then you can simply add it to the model: lmer(V ~ YR + (1|Transect) + (1|Transect:PT) + (1|Transect:PT:TR), data=TREES)

These are models with only a random intercept. You can add random slopes as well. E.g. if you want a random slope along year at the tree level:
lmer(V ~ YR + (1|Transect) + (1|Transect:PT) + (1 + YR|Transect:PT:TR), data=TREES)

Best regards,

Thierry

> -----Oorspronkelijk bericht-----
> Van: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-
> bounces at r-project.org] Namens Giancarlo Sadoti
> Verzonden: maandag 17 oktober 2011 8:40
> Aan: r-sig-mixed-models at r-project.org
> Onderwerp: [R-sig-ME] longitudinal analysis of nested samples
> 
> Greetings list,
> 
> I'm helping a colleague with an analysis of spatially-clustered longitudinal
> data.  She is interested in testing for change in vigor (V) in a set of trees over
> time.
> 
> In each of 5 years (YR), 4 trees (TR) were measured per point, 10 points (PT)
> were measured along a transect. There may be two additional levels (transect
> and site), but let's just consider one site on one transect for now.  V is normally-
> distributed, fyi.
> 
> My (basic) understanding of longitudinal models suggests I use the following
> model formulation (using lme4):
> 
> >lmer(V ~ YR + (YR|TR), data=TREES)
> 
> Linear mixed model fit by REML
> Formula: V ~ YR + (YR | TR)
>    Data: TREES
>   AIC  BIC logLik deviance REMLdev
>  1423 1449 -705.5     1415    1411
> Random effects:
>  Groups   Name        Variance   Std.Dev. Corr
>  TR       (Intercept) 0.00247886 0.049788
>           YR          0.00081403 0.028531 -0.065
>  Residual             0.71588684 0.846101 Number of obs: 560, groups: TR, 1
> 
> Fixed effects:
>              Estimate Std. Error t value
> (Intercept) 206.17857   35.89736   5.744 YR           -0.10107    0.03367  -3.002
> 
> Correlation of Fixed Effects:
>    (Intr)
> YR -0.531
> 
> The model indicates a negative trend in vigor over time. However, this only
> addresses the first level in the hierarchy (TR), if I wanted to address within-point
> variance in vigor, would I simply add a random intercept for point (1|PT)? (see
> below) Likewise, if I had additional levels of sampling (e.g. transect [TR]), would
> adding (1|TR) be appropriate?
> 
> > lmer(V ~ YR + (YR|TR) + (1|PT), data=TREES)
> Linear mixed model fit by REML
> Formula: V ~ YR + (YR | TR) + (1 | PT)
>    Data: TREES
>   AIC  BIC logLik deviance REMLdev
>  1326 1356 -655.8     1309    1312
> Random effects:
>  Groups   Name        Variance   Std.Dev.  Corr
>  PT       (Intercept) 1.4817e-01 0.3849224
>  TR       (Intercept) 2.8743e-03 0.0536120
>           YR          1.2003e-06 0.0010956 0.271
>  Residual             5.7145e-01 0.7559429 Number of obs: 560, groups: PT, 11; TR,
> 1
> 
> Fixed effects:
>              Estimate Std. Error t value
> (Intercept) 206.16368   32.07247   6.428 YR           -0.10107    0.01601  -6.313
> 
> Correlation of Fixed Effects:
>    (Intr)
> YR -0.998
> 
> It appears V varies between points (PT), and the model is much improved.  Is this
> the correct route?
> 
> Many thanks, and pardon me if this has been asked previously.
> 
> Giancarlo
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models




More information about the R-sig-mixed-models mailing list