2

I am using a mixed model in lmer to analyse some phenotype data across 3 levels of a treatment I am interested in, blocked by a random factor I am not interested in (just want to control for). So my model is basically:

model <- lmer( thing ~ treatment + (1|block) )

I have pilot data that gives me a measure of the variance of the phenotype 'thing' in this population. So I was hoping to use a power analysis to ask the question -

'Given the variance X in thing, how many samples would be needed to find significant differences across treatments?'

I was planning on running this power analysis for different hypothetical effect sizes. The thing is, I haven't even thought about power analysis since a distant stats lesson some time in my undergrad bio degree, and at that time I certainly wasn't told anything about dealing with them in mixed models.

I had a look at potential R functions and could only come up with the pwr package, which doesn't seem to have functionality for mixed models. I also came across some tutorials which started with a simulated dataset, but it didn't seem to address what I thought would be a simple problem (either that or I didn't understand).

I simply want to give the variance and [hypothetical] effect size, and get the sample size needed to find a significant difference - within the mixed model. Is this more complicated than I thought? Has anyone got any pointers of where I could look for some clear instruction, or functions I've missed that might be helpful?

Thanks in advance for any help,

Harriet

Robert Long
  • 53,316
  • 10
  • 84
  • 148
harriet86
  • 41
  • 1
  • 3
  • Also consider simulated power, as described here: http://stats.stackexchange.com/questions/21237/calculating-statistical-power/21243#21243 – Ashe Jun 15 '16 at 13:41
  • and check out the `longpower`, `odprism`, `simr`, `pamm` packages and see if one meets your needs – Ben Bolker Jun 16 '16 at 02:36

0 Answers0