Pergunta

I am performing a mixed model with nlme package in R. My situation is: The mixed model is:

MY = DFC + DFC2, random=~DFC|Animal, data=my_data)

where Animal is the random effect. However, if I write the model like this, I can only obtain random intercept, and slope for DFC (by Animal), but not DFC2. I would like to have also the random slope (by Animal) for DFC2! Could you please help me?

Thank you very much,

Foi útil?

Solução

If you use the library lme4

    library(lme4)
    fit <- lmer(y ~ x1 + x2 (1+ x1 + x2|group), data = test.df) 
    coef(fit)

Use coef() on your fitted object to see the slopes.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top