I'm searching for a built-in function in R for calculating the required sample size (given certain power, alpha,..) of a mixed ANOVA (2 between, 1 within variable, 2x2x2 design). Does this function exist? I didn't find it in the following packages:
•pwr is the oldest power-analysis library; some introductory info can be found on Quick-R
•PoweR: Computation of power and level tables for hypothesis tests
•Power2Stage: Power and Sample size distribution of 2-stage BE studies via simulations
•powerAnalysis: Power analysis in experimental design
•powerGWASinteraction: Power Calculations for Interactions for GWAS
•powerMediation: Power/Sample size calculation for mediation analysis, simple linear
regression, logistic regression, or longitudinal study
•powerpkg: Power analyses for the affected sib pair and the TDT design
•powerSurvEpi: Power and sample size calculation for survival analysis of epidemiological studies
•PowerTOST: Power and Sample size based on two one-sided t-tests (TOST) for (bio)equivalence studies
•longpower: Power and sample size for linear model of longitudinal data
Thanks!
Best Answer
I don't think a single function exists for your specific case. In fact once you move beyond the basics (those in your list above) any simple function would need to make several assumptions that you may or may not be happy with.
For more complex studies like this you can estimate power using simulation, and that way you control all the assumptions made instead of having to live with the assumptions of others.
The basic steps are:
Here is an answer to a similar question with examples of calculating power by simulation using R.