Re: [R] multilevel basic lme question

From: Dieter Menne <>
Date: Sun, 15 Jun 2008 18:54:38 +0000 (UTC)

eugen pircalabelu <eugen_pircalabelu <at>> writes:

> I want to use the lme package for a multilevel analysis on the
following example:
> > math<-c(2, 3,2, 5, 6 ,7 , 7)
> > sex<-c(1, 2, 1, 2, 2, 2, 1)
> > school_A<-c(1,1,1,2,2,2,2)
> > school_B<-c(10,10,10,20,20,20,20)
> > mydata<-data.frame(math, sex, school_A, school_B)
> > mydata

> School_A and school_B are two different school characteristics, math is

>> an individual score for each

> subject and sex is also an individual characteristic.
> Now i want to specify in R the following equations:
> math=a +b *sex +error1
> a= aa+ bb*school_A+ cc*school_B+ error2
> b= aaa+ bbb*school_A+ ccc*school_B+ error3
> but i don't know how. I searched nabble but could not find anything.

Looks like you mixed up aov and lme. There is no "error" term in lme, its counterpart is the "random=" term, and you probably read some of the aov literature.

I recommend having a look book by Pinheiro/Bates on mixed models, or at least checking the examples in the nlme directory.

Dieter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun 15 Jun 2008 - 19:00:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 15 Jun 2008 - 19:30:40 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive