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

Ben Bolker bbolker at gmail.com
Sat Oct 30 20:11:20 CEST 2010


Brian Willis <brian.willis <at> manchester.ac.uk> writes:

> 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) with
> an associated confidence interval for a given value of x.

[snippage: sorry to remove context, but I am posting via gmane, which
will complain if I have too much quoted context ...]

> 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?

  You should search the r-sig-mixed-models archive for answers, and
post there if you don't find what you need.  The problem is that it
can actually be a bit tricky to define these things properly for mixed
models, decide which random effects to include (or not) in the prediction
of the mean and include (or not) in the definition of the variance.
So far there has not been a confluence of people who want this,
people who know enough to construct a nice general solution, and
people who have time to do it ...

  Ben Bolker



More information about the R-help mailing list