[R-sig-ME] Confidence Intervals on Fitted Values from lmer
Mike.Lawrence at dal.ca
Sat Oct 2 10:02:50 CEST 2010
I thought I'd try to contribute a couple points:
1) Overlap of 95% CIs doesn't necessarily mean that two points can't
be considered as draw from populations of different means. On the
other hand, examining overlap of 84% CIs may let you make this
2) The latest version (2.1) of the ez package, released earlier this
week, has an ezPredict() function that obtains lmer model predictions
for fixed effects plus expected variance (n.b. the variance considers
fixed effects only). Mostly a wrapper around code found at the glmm
wiki (glmm.wikidot.com/faq), but possibly convenient.
3) When in doubt, bootstrap! :Op Depending on the complexity of your
design, you may find the ezBoot() function from the ez package
interesting. By default it can only accept 1 random effect, and fixed
effects aren't allowed to affect the intercept, but you could take a
look at its source and easily adapt it to a more complex situation
(though you'll need to give careful consideration to formulating a
proper sampling procedure in the context of those complications). Then
look to ezBootPlot() for visualization inspiration.
Department of Psychology
Looking to arrange a meeting? Check my public calendar:
~ Certainty is folly... I think. ~
On Fri, Oct 1, 2010 at 5:17 PM, Corey Godfrey
<Corey.Godfrey at cadmusgroup.com> wrote:
> Yes, that seems to be the tricky part. I am able to extract what I need for the fixed effects from the variance-covariance matrix. However, the resulting confidence intervals are much wider than I believe they should be. I think this might be because the random effects are helping to explain some of the variance in the data, resulting in "significant" t-values on my fixed effects of interest, but they (the random effects) are not included in the calculation of the confidence intervals. Therefore, a plot of the fitted values and confidence intervals appears to show a non-significant association between fitted values and my fixed effect of interest (i.e., you could draw a straight line between the CIs).
> I apologize for not including the code in my post, but it is quite lengthy. I am also not a statistician or an expert in R, so am doing my best to explain this problem without getting in too far over my head.
> -----Original Message-----
> From: dmbates at gmail.com [mailto:dmbates at gmail.com] On Behalf Of Douglas Bates
> Sent: Friday, October 01, 2010 3:55 PM
> To: Corey Godfrey
> Cc: r-sig-mixed-models at r-project.org
> Subject: Re: [R-sig-ME] Confidence Intervals on Fitted Values from lmer
> On Fri, Oct 1, 2010 at 2:33 PM, Corey Godfrey
> <Corey.Godfrey at cadmusgroup.com> wrote:
>> I would like to plot confidence intervals around the fitted values of a mixed effects model. Is this advisable? If so, is there a method for doing so?
> First you need to decide what kind of confidence interval you have in
> mind, involving the fixed-effects parameters only or both the fixed-
> and random-effects. You may be able to get what you want from the
> variance-covariance matrix for the estimates of the fixed-effects
> parameters, available as vcov(fittedModel), but I can't guarantee it.
> I would need to think more carefully about the interpretation of the
> various types of variability.
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models