Skip to contents

Calculate power for testing overall effects of treatment factors and their interactions, i.e., statistical power of ANOVA.

Usage

pwr.anova(design, alpha = 0.05, ...)

Arguments

design

a design object created using design generating functions.

alpha

significance level (type I error rate), default 0.05

...

Additional arguments passed to anova.lmerModLmerTest for linear mixed models and to Anova for linear models. The type of sum of squares (SS, default is Type III) and the method for computing denominator degrees of freedom (DDF, default is Satterthwaite's method) can be modified. For balanced designs, types of SS and DDF do not affect results. Note that these additional arguments should be consistent in the design-generating function and pwr.anova for linear mixed models.

Value

a data frame with numerator degrees of freedom (NumDF), denominator degrees of freedom (DenDF), non-centrality parameter, type I error rate (alpha), and power.

Examples

# generate an RCBD
rcbd = designRCBD(treatments = c(2, 2), blocks = 10, beta = c(10, 9, 8, 7), VarCov = 10, sigma2 = 9)
# power of omnibus test
pwr.anova(rcbd, alpha  = 0.05)
#> Power Analysis of Randomized Complete Block Design
#>           NumDF DenDF non-centrality alpha   power
#> facA          1    27        173.611  0.05 1.00000
#> facB          1    27        146.944  0.05 1.00000
#> facA:facB     1    27         13.611  0.05 0.94467