Skip to content

power analyses for mixed effects lmer models

4 messages · Greg Snow, Ben Bolker, LeeDetroit

#
Hi all,

I'm new (post #1!) and I hope you'll forgive me if I'm acting like an
idiot...

I have been asked for some power analyses for some mixed-effects models I'm
running using lmer. My studies nearly always contain mixes of
repeated-measures and between-subjects predictor variables.

As an example, suppose I want to see if men or women show a stronger word
frequency effect. I have 50 words of varying frequency that I show to 30 men
and 30 women, who are supposed to decide as quickly as possible whether it's
a real word. So my data object would end up being 3000 lines long, and look
like this:

Subject  Word  Sex  Frequency  ReactionTime
s1 w1 M 23 2543
s1 w2 M 67 1438
s1 w3 M 1 8033
...
s60 w50 F 4 1099

I analyze this with 

lmer(log(ReactionTime) ~ (Sex * Frequency) + (1|Subject) + (1|Word)

Does anyone know how I might do power analyses or compute effect sizes in
this kind of situation?

Thanks.

--Lee
#
My preferred method for this type of thing is to use simulation.  You have already done the hard parts in figuring out what your data is going to look like and how you plan to analyze it.  Now just write a function that will simulate data according to your pattern and with the difference(s) that you want to compute the power for, then analyzes the simulated data and returns the value of interest (usually a single p-value, but could be something else).  Now run this function a bunch of times (I would use the replicate function to do this) and see how often the conclusion of interest occurs (p-val < alpha, or something else).  This is your estimate of power.

Hope this helps,
#
Greg Snow <Greg.Snow <at> imail.org> writes:
Agreed.

   There are power calculators out there for standard
ANOVA designs, even mixed models 
e.g. <http://www.stat.uiowa.edu/~rlenth/Power/> ,
but they're very unlikely to work for a crossed-random-effects
model with a continuous and a categorical predictor.

  If you have further questions along these lines I would
recommend the r-sig-mixed-models list.

  Ben Bolker
#
Greg and Ben,

Thanks for the suggestions. I'll give it a try, and I'll also poke around to
find the r-sig-mixed-models list. What a wonderful world we live in that
such a thing exists!

--Lee