Skip to content
Prev 113 / 20628 Next

lme question: separate serial correlation parameters by strata

I'm not sure if this is appropriate for this list since this may 
be a very elementary question, but here it is:

I am working with data similar to the BodyWeight data set in the 
nlme package (Appendix A3 and pages 104 and 245 of Pinheiro & Bates)

I'd like to fit a model such as this

fit <- lme(weight ~ Time * Diet,
            data = BodyWeight,
            random = ~ Time,
            correlation = corCAR1(form = ~ Time))

but with a separate phi for each level of Diet.

My reasoning is that the autocorrelation may decay over time at 
different rates for the three diets.  (When I fit a separate 
model for each diet, I get estimates for phi of 0.85 for diet 1, 
0.83 for diet 2, and 0.53 for diet 3. I take this as some 
empirical support for this approach)

Can I do this using lme? (I'm using R 2.4.1 on 
sparc-sun-solaris2.10 with nlme version 3.1-78.)

Thank you,

Stephen