Calculate power for testing various contrasts. The same syntax of emmeans package is employed to specify contrast types.
Arguments
- design
a design object created using design generating functions.
- specs
an argument inherited from emmeans specifying the names of the factors over which the contrasts are performed.
- method
an argument inherited from contrast specifying the method of contrasts, e.g., pairwise, linear, and polynomials.
- alpha
significance level (type I error rate), default 0.05
- ...
other arguments passed to contrast.
Examples
rcbd = designRCBD(treatments = c(2, 2), blocks = 10, beta = c(10, 9, 8, 7), VarCov = 10, sigma2 = 9)
pwr.contrast(rcbd, specs = ~ facA|facB, method = "pairwise")
#> contrast facB estimate df non-centrality alpha power
#> 1 facA1 - facA2 1 -9 27 45.0000 0.05 0.9999965
#> 2 facA1 - facA2 2 -16 27 142.2222 0.05 1.0000000