Interpretation of Errors bars

112 views
Skip to first unread message

Michael

unread,
Jan 14, 2013, 11:03:25 AM1/14/13
to ez...@googlegroups.com
Hi,
I'm trying to use ezPlot2 to plot error bars based on the model predictions of the following model:

model.rduration=lmer(relduration~focus+(1+focus|item)+(1+focus|participant), data=acoustics)

preds = ezPredict(
fit = model.rduration
, zero_intercept_variance = FALSE
)

pd = ezPlot2( 
preds 
, x = .(focus)
)

pd=pd+theme_bw(18)
print(pd)


According to the model there is a highly significant effect:

Fixed effects:
               Estimate Std. Error t value
(Intercept)    -0.03850    0.04052  -0.950
focusPredicate -0.06963    0.01469  -4.741

But based on the error bars the difference looks non-significant (attached).  
Am I doing something wrong?

Thanks,
Michael
focus.pdf

Mike Lawrence

unread,
Jan 14, 2013, 11:11:08 AM1/14/13
to ez...@googlegroups.com
By default, ezPredict returns error bars that reflect the uncertainty of all fixed effect parameters in the model, including the intercept. Since the intercept is usually not a particularly interesting parameter, you can turn off the inclusion of intercept uncertainty by setting the "zero_intercept_variance=T" in your call to ezPredict. 

Mike

Michael

unread,
Jan 14, 2013, 11:19:30 AM1/14/13
to ez...@googlegroups.com
Thanks! I did this, but then the error interval around the first mean becomes zero, and I didn't know how to interpret this. So are the error bars around the other level then roughly an estimate of the confidence interval of the contrast between the two levels? Is this a valid way to visualize comparisons between levels of a factor?

Michael

unread,
Jan 14, 2013, 11:25:59 AM1/14/13
to ez...@googlegroups.com
Also, a related question, maybe this is obvious, but not to me: Can I use ezPredict to estimate p-values of contrasts in a mixed model? 

Mike Lawrence

unread,
Jan 14, 2013, 11:41:15 AM1/14/13
to ez...@googlegroups.com
Ah, you should first set the contrasts to something that makes the intercept independent of the levels of your effect. "contr.helmert" is what I use (it's equivalent to "contr.sum" when there are only two levels). Then refit the model and re-run ezPredict.
--
Cheers,

Mike

--
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University

Looking to arrange a meeting? Check my public calendar: http://goo.gl/BYH99

~ Certainty is folly... I think. ~

Mike Lawrence

unread,
Jan 14, 2013, 8:49:40 PM1/14/13
to ez...@googlegroups.com
ezPredict does an a posteriori bootstrap (i.e. uses the model's estimates of variances to obtain samples of the condition means), but it ignores the random effects variance, so I'm guessing that some might take issue with using the resulting 95% bootstrap CIs for inference (at least, if you do use them in this manner, you'd want to ensure your readers know precisely what you did). If you follow the R-SIG-Mixed Models list, there are occasional discussions on attempts to derive p-values from mixed effects models and the folly therein. Hence ezMixed's likelihood ratio approach (though note that more recently, through explorations of the rStan package, I've become increasingly suspicious that I'll eventually become a Bayesian).

ch...@mcgill.ca

unread,
Jan 15, 2013, 12:08:25 AM1/15/13
to ez...@googlegroups.com
thanks, this is really helpful!
Michael.
~~
prosodylab.mcgill.ca




Reply all
Reply to author
Forward
0 new messages