Date: Mon, 17 Oct 2011 08:20:19 +0000
From: "ONKELINX, Thierry" <Thierry.ONKELINX at inbo.be>
To: Giancarlo Sadoti <gcsadoti at yahoo.com>,
"r-sig-mixed-models at r-project.org" <r-sig-mixed-models at r-project.org>
Subject: Re: [R-sig-ME] longitudinal analysis of nested samples
Message-ID:
<AA818EAD2576BC488B4F623941DA74273B8A26EA at inbomail.inbo.be>
Content-Type: text/plain; charset="iso-8859-1"
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