## 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