Hello,

Indeed, implementing the fitted and resid calls on the fm1 object from 
example(lmer), the fitted function worked, but the resid did not:

> resid(fm1)
Error in resid(fm1) : no slot of name "family" for this object of class "lmer"

I am using R 2.4.0 (on Windows XP), with the update of lme4 (lmer within) 
written for 2.4.0.

Thanks, Joel.




> Message: 79 Date: Fri, 17 Nov 2006 03:14:24 +0100 From: "Renaud 
> Lancelot" <[EMAIL PROTECTED]> Subject: Re: [R] lme4 package: 
> Fitted values and residuals To: "Douglas Bates" <[EMAIL PROTECTED]> 
> Cc: r-help@stat.math.ethz.ch, Frank Johannes <[EMAIL PROTECTED]> 
> Message-ID: 
> <[EMAIL PROTECTED]> 
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 
> 2006/11/16, Douglas Bates <[EMAIL PROTECTED]>:
>> > On 11/16/06, Frank Johannes <[EMAIL PROTECTED]> wrote:
>>> > > Dear all,
>>> > > I have three concerns:
>>> > > 1)
>>> > > I am running models with the lme4 package. I cannot find a way to pull
>>> > > out a vector of the fitted values and the residuals. Does anybody know
>>> > > how to do it?
>> >
>> > The fitted() and resid() extractor functions are the usual way of
>> > doing this for a fitted model in R and, astonishingly enough, they
>> > work!  Try
>> >
>> > library(lme4)
>> > example(lmer)
>> > fitted(fm1)
>> > resid(fm1)
>
> But resid does not seem to work with GLMMs:
>
>> > library(lme4)   ##  version 0.9975-9
> Le chargement a n?cessit? le package : Matrix
> Le chargement a n?cessit? le package : lattice
>> > m1 <- lmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
> +             family = binomial, data = cbpp)
> relative tolerance set to 9.8721686386158e-05
>> > resid(m1)
> Erreur : 'resid' n'est pas encore impl?ment?
>
> [in English: Error: 'resid' is not implemented yet]
>
> Best,
>
> Renaud
>

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to