[R] How to include multiple random effects in 'lme' function

karena dr.jzhou at gmail.com
Wed Jun 15 03:51:49 CEST 2011


How to include multiple random effects in a 'lme' function?

For example, I want to set up 'days' and 'subject' as my random effects,

library(nlme)
fm <- lme(trait~time+money, random=~days|subject, data=example)

However, if I have the following SAS code:
----------------------------------------------
proc mixed data=example; class time money;
model trait=time money time*money/noint s;
random     days/sub=subject;
random  int/sub=pedigreeID;
title 'random slope model with family effects';
run;
--------------------------------------------
In this SAS code, it has multiple random effects, how can I convert this SAS
code to R code?

library(nlme)
fm <- lme(trait~time+money, random=list(???????????), data=example)

How should I fill up the list()?

thank you very much,

Karena



--
View this message in context: http://r.789695.n4.nabble.com/How-to-include-multiple-random-effects-in-lme-function-tp3598339p3598339.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list