Last chance! 50% off unlimited learning
Sale ends in
Compute the power of a Williams' test, or determine parameters to obtain a target power.
power.williams.test(n = NULL, k, delta, sd = 1, power = NULL, ...)
Object of class ‘power.htest
’, a list of the arguments
(including the
computed one) augmented with method and note elements.
number of observations (per group).
number of treatment groups.
clinically meaningful minimal difference (between a treatment group and control).
common standard deviation.
power of test (1 minus Type II error probability).
further arguments, currently ignored.
Exactly one of the parameters n
or power
must be passed as NULL
, and that
parameter is determined from the others.
The function has implemented the following Eq. in order to estimate power (Chow et al. 2008):
with
The required sample size (balanced design) is estimated numerically
(see optimise
). The optimal sample size
is searched within the interval of
Chow, S.-C., Shao, J., Wan, H., 2008, Sample Size Calculations in Clinical Research, 2nd ed, Chapman & Hall/CRC: Boca Raton, FL.
optimise
williamsTest
## Chow et al. 2008, p. 288 depicts 53 (rounded),
## better use ceiling for rounding
power.williams.test(power = 0.8, k = 3, delta = 11, sd = 22)
power.williams.test(n = 54, k = 3, delta = 11, sd = 22)
## PASS manual example:
## up-rounded n values are:
## 116, 52, 29, 14, 8 and 5
## according to PASS manual, p. 595-5
D <- c(10, 15, 20, 30, 40, 50)
y <- sapply(D, function(delta) {
power.williams.test(power = 0.9, k = 4, delta = delta, sd = 25)$n
})
ceiling(y)
if (FALSE) {
## compare with power.t.test
## and bonferroni correction
power.t.test(power = 0.9, delta = 50, sd = 25,
sig.level = 0.05 / 4, alternative = "one.sided")
}
Run the code above in your browser using DataLab