[R] Confidence interval for response variable in mixed effects models

David Winsemius dwinsemius at comcast.net
Sat Oct 30 20:53:36 CEST 2010


On Oct 30, 2010, at 11:33 AM, Brian Willis wrote:

> HI,
>
> I am using lmer() for a simple mixed effects model. The model is of  
> the form
> logit(y)~ x + (1|z), where x is an indicator variable and z a multi- 
> level
> factor.
>
> I would like an estimate of the response variable (either y or logit  
> y)

There is a fitted method for objects of class "mer".

?"mer-class"

> .... with an associated confidence interval for a given value of x.

That is the sticking point as I understand it. See below.
>
> There does not appear to be a predict function written for lmer().
>
> The output for the fixed effects gives a standard error for the  
> intercept,
> the coefficient of x and the correlation. For n observations, I  
> transform
> the std errors to variances, and with the correlation, I think I can  
> use the
> formula Var(intercept + x) = Var(intercept) + Var(x) +  
> 2Cov(x,intercept) to
> get the variance of the fixed effects component of the response  
> variable.
>
> However, I would like to include the random effects component of the
> variance, so I may derive a standard error and confidence interval  
> for the
> variance.
>
> Does anyone know how to do this? Is there a ready made function like
> predict() or does anyone know how to incorporate the variance of  
> random
> effects term to derive the std error of the response variable?

I see Ben Bolker has offered a suggestion that you search the mixed  
models list.

An earlier question on this topic elicited this citation (from Bolker):

http://glmm.wikidot.com/faq

One of the available choices in Baron's search page is R-sig-mixed- 
models and here are a few links to threads (by people who know more  
than me) that may offer at least informed commentary and options if  
not a general solution (from  both R-help and the SIG-ME archives):

http://search.r-project.org/cgi-bin/namazu.cgi?query=+confidence+intervals+lmer&max=100&result=normal&sort=score&idxname=functions&idxname=Rhelp08&idxname=Rhelp10&idxname=R-sig-mixed-models&idxname=Rhelp02

http://finzi.psych.upenn.edu/Rhelp10/2008-May/161516.html

http://rwiki.sciviews.org/doku.php?id=guides:lmer-tests

http://finzi.psych.upenn.edu/R/Rhelp02/archive/76742.html

http://finzi.psych.upenn.edu/R/Rhelp02/archive/81237.html

http://finzi.psych.upenn.edu/R/Rhelp02/archive/82567.html

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list