Skip to contents

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

Usage

pwr.anova(object, sig.level = 0.05, type = c("III", "II", "I", "3", "2", "1"))

Arguments

object

a design object created in pwr4exp

sig.level

significance level, default 0.05

type

the type of ANOVA table requested, default Type III

Value

a data frame with numerator degrees of freedom (NumDF), denominator degrees of freedom (DenDF), type I error rate (sig.level), and power.

Examples

# generate an RCBD
rcbd <- designRCBD(
  treatments = c(2, 2),
  label = list(facA = c("1", "2"), facB = c("1", "2")),
  blocks = 12,
  formula = ~ facA*facB + (1|block),
  means = c(32, 35, 30, 37),
  vcomp = 4,
  sigma2 = 6
)
# power of omnibus test
pwr.anova(rcbd)
#> Power of type III F-test
#>           NumDF DenDF sig.level   power
#> facA          1    33      0.05 1.00000
#> facB          1    33      0.05 0.05000
#> facA:facB     1    33      0.05 0.78387