[R] REML with random slopes and random intercepts giving strange results

Simon Pickett S.Pickett at exeter.ac.uk
Wed Aug 16 13:14:11 CEST 2006


Hi again,
Even stranger is the fact that the coefficeints (the slope) and the
intercepts are not independent, in fact they are directly inversely
proportional (r squared = 1).
This means that that there isnt a random slope and intercept for each
individual (which is what I wanted), but straight line that pivots in the
middle and will change from individual to individual. Is there a problem
with the way I have structured the random model or a deeper problem with
lmer()?
here is the code I used
m2 <- lmer(changewt ~ newwt+(newwt|id), data = grow)
coef(m2)
Any suggestions very much appreciated,
Simon


> I don't this is because you are using REML. The BLUPs from a mixed model
> experience some shrinkage whereas the OLS estimates would not.
>
>> -----Original Message-----
>> From: r-help-bounces at stat.math.ethz.ch
>> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Simon Pickett
>> Sent: Tuesday, August 15, 2006 11:34 AM
>> To: r-help at stat.math.ethz.ch
>> Subject: [R] REML with random slopes and random intercepts
>> giving strange results
>>
>> Hi everyone,
>> I have been using REML to derive intercepts and coeficients
>> for each individual in a growth study. So the code is
>> m2 <- lmer(change.wt ~ newwt+(newwt|id), data = grow)
>>
>> Calling coef(model.lmer) gives a matrix with this information
>> which is what I want. However, as a test I looked at each
>> individual on its own and used a simple linear regression to
>> obtain the same information, then I compared the results. It
>> looks like the REML method doesnt seem to approximate the two
>> parameters as well as using the simple linear regression on
>> each individual separately, as judged by looking at graphs.
>> Indeed, why do the results differ at all?
>> Excuse my naivety if this is a silly question.
>> Thanks to everyone for replying to my previous questions,
>> very much appreciated.
>> Simon Pickett
>> PhD student
>> Centre For Ecology and Conservation
>> Tremough Campus
>> University of Exeter in Cornwall
>> TR109EZ
>> Tel 01326371852
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch 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.
>>
>


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