[R-sig-ME] Analysis of repeated measures when fixed effect changeswithin-subjects?
David Duffy
David.Duffy at qimr.edu.au
Mon Aug 5 06:59:21 CEST 2013
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
More information about the R-sig-mixed-models
mailing list