Question

This is a programming question for people who like to use the ez package in R. I am accustomed to using linear mixed effects models with lmer(). Among the useful outputs of lmer (), I get a coefficient value for each of my experimental factors, and using pvals.fnc() I can easily get 95% confidence intervals (CI) to report together with the model coefficients.

I have recently started using ezANOVA, and I would like to know: Is there a mainstream way to get the same output? That is, I'd like to get a value for the coefficient of an experimental factor and a CI to go along with it. Here is sample code to make this concrete:

library(languageR) #necessary to use pvals.fnc()
library(lme4)      #necessary for lmer()
library(ez)        #necessary for ezANOVA
data(ANT)          #load sample data

If I were using lmer, I would estimate my model and then get 95% CIs for the coefficients:

model_lmer = lmer( formula = rt ~ cue*flank + (1|subnum), data = ANT)
pvals.fnc(model_lmer, withMCMC=T)$fixed

So, for example, I know that the estimate of the interaction between cue and flank (when cue has the level "center" and flank has the level "congruent") is -3.9511 and the 95% CI is [-12.997, 5.535]

Now say that I want to run an anova by-subjects and by-items using ezANOVA, and I want to get 95% CIs for the by-subject estimates. This is my model:

model.f1 = ezANOVA(data=ANT, dv=rt,wid=subnum,within=.(cue,flank),return_aov=T)

But in the output, I don't see the model estimates when I do:

model.f1$ANOVA

And I don't know how to calculate the 95% CIs corresponding to those estimates. I think I should be able to use ezBoot() but I tried and I'm not sure how to implement it.

Any suggestions? Thanks for your help!

Was it helpful?

Solution

This answer was provided by the author of the "ez" package in another forum. I'm copying it here in case someone else finds it useful:

"One somewhat hacky way to get CIs for effects is to use ezStats () to get the means 
and FLSD, compute the difference between the means to get the effect, 
and divide the FLSD by sqrt(2) to get the CI" 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top