[R-sig-eco] Confidence intervals in lmer

Ben Bolker bbolker at gmail.com
Mon Oct 24 03:10:53 CEST 2011


Chris Howden <chris at ...> writes:

> 
> U could try the predict function with se.fit=true. I believe this
> should give u the predicted score and se and u can calculate CI from
> there.
> 
> U'll have to create an input matrix with the score u want to predict for.

  Unfortunately, predict() doesn't currently exist for lmer models,
and se.fit doesn't even work for lme models.

  There's some code on http://glmm.wikidot.com/faq for computing
predictions and standard errors of predictions.  Note, however,
that these recipes do not take into account the uncertainty in the 
estimates of the random-effects variance (something that as far
as I can tell no-one has a recipe for).

> 
> Chris Howden
> 
> On 27/09/2011, at 23:23, Adam Hayward <a.hayward at ...> wrote:
> 
> > Dear list members,
> >
> > I have a significant interaction between two continuous variables (it
> > happens to be a mixed model in lmer, but I imagine the same is applicable to
> > a glm). The interaction tells me that the relationship between z and y
> > changes as a function of x, but I want to know whether y has a significant
> > effect on z at a given value of x. For instance, the interaction might show
> > that the relationship between body weight and fitness changes with age, but
> > I want to know if the association between body weight and fitness is
> > significantly positive at the age of 1. Therefore, I'd like to estimate 95%
> > CIs or SEs around the association between body weight and fitness at a given
> > age, but have yet to work out how to do it. Any suggestions would be greatly
> > appreciated.
> >
> > Best wishes,
> > Adam
> >
> >



More information about the R-sig-ecology mailing list