[R] help with structuring random factors using lmer()

Simon Pickett S.Pickett at exeter.ac.uk
Thu Aug 10 16:00:56 CEST 2006


Hi,
I am an R beginner and having problems structuring my REML models. I have
a model with
y=weight
x1=time
x2=timesquared
id=individual identity
I need to structure the model such that in the random effects there is a
constant intercept for all individuals but a separate individual slope for
both x1 and x2 (a coefficient score for every individual).
m1<-lmer(weight~time+timesq+(1|id)+(timesq-1|id)+(time-1|id), data=dataset)
coef(m1)
gives me nearly what I want except there isnt an individual coefficient
score for each individual for x2.
Any suggestions very much appreciated.
Simon Pickett
s.pickett at exeter.ac.uk



Simon Pickett
PhD student
Centre For Ecology and Conservation
Tremough Campus
University of Exeter in Cornwall
TR109EZ
Tel 01326371852



More information about the R-help mailing list