Hello all,

In lme4 if you want to model two non-nested random effects you code it like
this:

mod1 <- lmer(y~x + (1|randomvar1) + (1|randomvar2))

How would you go about to model something similar in nlme?

In my database I have two variables for which I have repeated measures, lets
call them "individual" and "year".
But none of the "individuals" were measured in more than one year. So as I
understand it, I should not nest individual in year or visa versa.
 Someone suggested I do it as above. But I am accustomed to nlme, and dont
know how one would code non-nested random effects.

In the Pinheiro and Bates book there is an example coded like this:
modB <- lme(y~x,
  +   random = pdBlocked(list(pdIdent(~year-1), pdIdent(~individual-1))))

But when I try it I keep getting an error message saying:  "Error in
getGroups.data.frame(dataMix, groups) : 
  Invalid formula for groups"

What am I doing wrong?

Thank you,

--
View this message in context: 
http://r.789695.n4.nabble.com/model-non-nested-random-effects-in-nlme-library-tp4321021p4321021.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to