s-news
[Top] [All Lists]

Re: Random effects in summary lme

To: "Jimenez-Leal William" <william.jimenezleal@lsc.gov.uk>
Subject: Re: Random effects in summary lme
From: "Douglas Bates" <bates@stat.wisc.edu>
Date: Tue, 20 Nov 2007 11:46:23 -0600
Cc: s-news@lists.biostat.wustl.edu
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=HrezQ/tZ1LjAx6LpwPshEkMlEeOTsibn4hU/8lh1q4A=; b=QVrDG7tlkyOEcgt+IEOV6EuUP7c/k0eU/H/HiPK9P/uITZvKRwha1bmWNl9kk3j7FFCV2BxwAtl0Quzj71nSw4KEbFXrGh03iNuF5d/py/yo2YaqVjA6aYobkLIfEeX5CXJ0Mb2oDDkF2GraN4O88L5FbKcQcy37x7v9dIkHUTU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=BJYeyLFCEJBjfmEq+kQPvGyH28q89tSureN+PWvykRfoq8+ArEmbPge0JgLW0LNKv/DD032+Useg1+c/SriwsmgccsU4M6cqk/pDTkqnFxF037WmBlS49rKpziHXOwOPRBnSMkUxr7vwR9qALG7o9miIqGR8amEUqTLz0iGLiAw=
In-reply-to: <BF6EA021B2A77C46B86FF9112F45972101A240A9@E2K3VS02.lsc.local>
References: <1D98C2C866C7D34DB400A10594D55E810585D9E8@E2K3VS02.lsc.local> <BF6EA021B2A77C46B86FF9112F45972101A240A9@E2K3VS02.lsc.local>
On Nov 13, 2007 9:55 AM, Jimenez-Leal William
<william.jimenezleal@lsc.gov.uk> wrote:
> Dear S plus users,

> I am fitting a bunch of mixed effects logistic regressions using glmmPQL and
> I have a little problem extracting their random coefficients. I am modeling
> the probability of passing an exam against student's prior attainment,
> allowing the latter to vary randomly across schools. Looks something like
> this

> a<-glmmPQL(POINTS~PA +PA2+PA3,random=~PA|INST, family=binomial(link=logit),
> data=x, niter=1000)

> ('pa' is the prior attainment, 'inst' is school)

> Normally, I just produce a summary of this object, which gives you the
> corresponding standard deviations and correlations, and work out the
> variance-covariance matrix from there. This is the summary:

> summary(a)

> Linear mixed-effects model fit by maximum likelihood

>  Data: k

>        AIC      BIC    logLik
>   18142.24 18189.96 -9063.118

> Random effects:
>  Formula:  ~ PA | INST
>  Structure: General positive-definite
>                 StdDev   Corr
> (Intercept) 3.68174225 (Intr)
>     PA      0.09902275 0.253
>    Residual 0.60168538

>  Variance function:
>  Structure: fixed weights
>  Formula:  ~ invwt

> (Etc, etc)
> Number of Observations: 2881
> Number of Groups: 142

> The problem is that when I extract this matrix from the summary object
> directly, the random effects numbers do not match.

> summary(a)$modelStruct$reStruct
> Random effects:
>  Formula:  ~ PA | INST

>  Structure: General positive-definite
>                StdDev   Corr
> (Intercept) 6.1190489 (Intr)
>      PRIORC 0.1645756 0.253
>    Residual 1.0000000

> Would anyone tell me what I am missing here? Clearly, the matrix is being
> transformed when summarized, but why and how?

The actual optimization in the lme function is done on the scale of
the relative variance-covariance of the random effects.  That is, the
variance-covariance of the random effects is expressed as a multiple
of the "sigma^2" in the variance of the observations given the random
effects.  If you extract only the reStruct it will show the residual
variance and standard deviation as unity.

For this model you may question which of the variance-covariance
estimates you want to use.  In the case of a binomial distribution for
the responses there is no separate variance parameter.  The
conditional mean determines the conditional variance.  The estimate of
a "Residual" variance occurs only because of the PQL approximation.
According to the model the second variance covariance matrix, where
the residual variance and standard deviation has been set to unity,
would be the correct one to use.

<Prev in Thread] Current Thread [Next in Thread>