An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20130802/7f902df0/attachment.pl>
Analysis of repeated measures when fixed effect changes within-subjects?
2 messages · Nicole Michel, David Duffy
2 days later
On Sat, 3 Aug 2013, Nicole Michel wrote:
I'm helping a colleague with a repeated-measures analysis in which each
subject's fixed effect changes over the course of data collection. He's
measuring a continuous, positive response variable (`Response`) in
agricultural plots (`ID`) (which themselves are grouped within `Blocks`) as
a function of `Crop` type. The response variable is measured 4 times over
the course of the season. The analysis would normally look something like
this:
modelout <- lmer(Response ~ Crop + (Month|ID) + (1|Block) ,
data=cropdata, family=gamma(link="inverse"))
However, just to make things complicated, the first measurement is done
prior to planting, so it's influenced by the *previous year's* crop type.
That is, for plot A1, Month 1's `Crop` is Wheat, but Month 2-4's `Crop`
types are Barley. Is there any way to analyze this in a single model?
Unless you think some kind of autoregressive model is needed, won't your example there work fine, after testing your compound model Crop1*Crop234? Otherwise, one way would be lme with corAR1, possibly transforming Response... | David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v