[R-sig-ME] Additive random effects un lme

Ben Bolker bbolker @ending from gm@il@com
Thu Sep 20 03:46:39 CEST 2018



  These are also called "crossed" random effects.  lme can do them in a
limited and complex way -- the syntax is given somewhere in one of the
later chapters of the Pinheiro and Bates 2000 book [see
https://stackoverflow.com/questions/36342072/how-to-get-two-random-effects-crossed-with-one-nested-in-the-other-in-nlme
] but it's much easier with lme4::lmer (y ~ 1 + (1|A) + (1|B)). Do you
have a reason you have to stick with lme?



On 2018-09-19 01:33 PM, Matías Alejandro Castillo Moine wrote:
> Hi everybody!
> 
> Additive random effects in lme
> 
> 
> I�m working with lme() R function. I want to fit the following model y=u+A+B+e (where y is the response variable, u the general mean, A and B two categorical variables, and e the error term) but using only u as an fixed effect (so A and B must to be random effects but with additive response). How I can specify this model in lme function?
> 
> At moment, I was found this manner:
> 
> 
> lme(y~1, random= ~1|A/B, data)
> 
> 
> But the problem is that, according to the documentation of nlme package, that sintaxis will to fit an nested model of B nested on A.
> 
> 
> In my case y are several biometrics variables of a crop, A are environments and B are genotypes. The term e will to include the interaction between A and B. Also, the error term is spatially correlated (I use the correlation argument for clean this effect).
> 
> 
> Thanks you for your help!
> 
> 
> Best regards,
> 
> 
> Mat�as A. Castillo Moine
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



More information about the R-sig-mixed-models mailing list