[R] Understanding and translating lme() into lmer() model

Petar Milin pmilin at ff.ns.ac.yu
Thu Jan 5 13:47:35 CET 2006


I am newbie in R, trying to understand and compare syntax in nlme and
lme4. lme() model from the nlme package I am interested in is:
	lme.m1.1 = lme(Y~A+B+C,random=~1|D/E,data=data,method="ML")
(for simplicity reason, I am giving generic names of factors)
If I understand well, there are three fixed factors: A, B and C, and two
random factors: D and E. In addition to that, E is nested in D, isn't
it? Of course, method is Maximum Likelihood.
If I would like to translate the above model to one suitable for lmer(),
it should look like this:
	lmer.m1.1 = lmer(Y~A+B+C+(1|D:E),data=data,method="ML")
Am I right? Is '/' in nlme same as ':' in lme4?

Sincerely,
Peter M.




More information about the R-help mailing list