View source: R/power.dunnett.test.R
| power.dunnett.test | R Documentation |
Compute average per-pair power of Dunnetts's multiple comparison test with one control.
power.dunnett.test(n, groups, delta, within.var, sig.level = 0.05)
n |
Number of observations (per group) |
groups |
Number of groups (including control) |
delta |
true difference in means |
within.var |
Within group variance |
sig.level |
Significance level (Type I error probability) |
The function has implemented the following Eq. to estimate average per-pair power for two-sided tests:
1 - \beta = 1 - t( T_{\alpha \rho v}, v, \mathrm{ncp}) +
t(-T_{\alpha \rho v}, v, \mathrm{ncp}),
with T_{\alpha \rho v} the two-sided
\alpha quantile of
the multivariate t-distribution, with v = k (n - 1)
degree of freedom, k the number of groups
and correlation matrix \rho_{ij} = 0.5 ~ (i \neq j).
The non-centrality parameter for the non-central student t-distribution is
\mathrm{ncp} = |\Delta| / \sqrt{s_{\mathrm{in}}^2 ~ 2 / n }.
Object of class ‘power.htest’,
a list of the arguments
(including the computed one) augmented with
method and note elements.
The results for power are seed depending.
The Eqs. were taken from Lecture 5, Determining Sample Size, Statistics 514, Fall 2015, Purdue University, IN, USA.
TDist qmvt
powerMCTests
set.seed(113)
power.dunnett.test(n = 9, groups = 5, delta = 30,
within.var = 333.7)
## compare with t-test, bonferroni corrected
power.t.test(n = 9, delta = 30, sd = sqrt(333.7),
sig.level = 0.05 / 4)
## Not run:
## asymptotic Monte-Carlo power analysis
set.seed(113)
powerMCTests(mu = c(rep(0,4), 30), n = 9,
parms = list(mean = 0, sd = sqrt(333.7)),
test = "dunnettTest", alternative = "two.sided")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.