Re: [R] residuals in lmer

From: Douglas Bates <bates_at_stat.wisc.edu>
Date: Tue 26 Apr 2005 - 10:00:03 EST

Jacob Michaelson wrote:

> 
> On Apr 24, 2005, at 11:42 PM, Renaud Lancelot wrote:
> 

>> Jacob Michaelson a écrit :
>>
>>> Does anyone know how to extract residuals in lmer?
>>> Here's the error I get:
>>> >
>>> crop.lme=lmer(response~variety*irrigation*pesticide+(1|rep)+(1|rep:
>>> pesticide)+(1|rep:pesticide:irrigation), crop.data)
>>> > qqnorm(crop.lme)
>>> Error in qqnorm.default(crop.lme) : y is empty or has only NAs
>>> > resid(crop.lme)
>>> NULL
>>> Thanks!
>>> --Jake
>>> ______________________________________________
>>> R-help@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
>>
>> I'm afraid they're not (yet) available. At least, you can write a
>> small function to compute response residuals, using predictions from
>> the fixed and random parts, built with model.matrix(), fixef() and
>> ranef(). Let me know if you need an example (I'm not available this
>> morning).
> 
> 
> 
> Sure, an example would be very helpful, thanks!

Version 0.95-6 of the lme4 package has an lmer method for resid and for residuals.



R-help@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 Received on Tue Apr 26 10:09:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:26 EST