powerMCTests | R Documentation |
Performs power simulation for one-factorial all-pairs and Many-To-One comparison tests.
powerMCTests(
mu,
n = 10,
errfn = c("Normal", "Lognormal", "Exponential", "Chisquare", "TDist", "Cauchy",
"Weibull"),
parms = list(mean = 0, sd = 1),
test = c("kwManyOneConoverTest", "kwManyOneDunnTest", "kwManyOneNdwTest",
"vanWaerdenManyOneTest", "normalScoresManyOneTest", "dunnettTest",
"tamhaneDunnettTest", "ManyOneUTest", "chenTest", "kwAllPairsNemenyiTest",
"kwAllPairsDunnTest", "kwAllPairsConoverTest", "normalScoresAllPairsTest",
"vanWaerdenAllPairsTest", "dscfAllPairsTest", "gamesHowellTest", "lsdTest",
"scheffeTest", "tamhaneT2Test", "tukeyTest", "dunnettT3Test", "pairwise.t.test",
"pairwise.wilcox.test", "adManyOneTest", "adAllPairsTest", "bwsManyOneTest",
"bwsAllPairsTest", "welchManyOneTTest"),
alternative = c("two.sided", "greater", "less"),
p.adjust.method = c("single-step", p.adjust.methods),
alpha = 0.05,
FWER = TRUE,
replicates = 1000
)
mu |
numeric vector of group means. |
n |
number of replicates per group. If |
errfn |
the error function. Defaults to |
parms |
a list that denotes the arguments for the error function.
Defaults to |
test |
the multiple comparison test for which the power analysis is
to be performed. Defaults to |
alternative |
the alternative hypothesis. Defaults to |
p.adjust.method |
method for adjusting p values (see |
alpha |
the nominal level of Type I Error. |
FWER |
logical, indicates whether the family-wise error should be computed.
Defaults to |
replicates |
the number of Monte Carlo replicates or runs. Defaults to |
The linear model of a one-way ANOVA can be written as:
X_{ij} = \mu_i + \epsilon_{ij}
For each Monte Carlo run, the function simulates \epsilon_{ij}
based on the given error function and
the corresponding parameters. Then the specified all-pairs
or many-to-one comparison test is performed.
Finally, several effect sizes (Cohen's f ans R-squared),
error rates (per comparison error rate,
false discovery rate and familywise error rate)
and test powers (any-pair power, average per-pair power
and all-pairs power) are calculated.
An object with class powerPMCMR
.
## Not run:
mu <- c(0, 0, 1, 2)
n <- c(5, 4, 5, 5)
set.seed(100)
powerMCTests(mu, n, errfn="Normal",
parms=list(mean=0, sd=1),
test="dunnettTest", replicates=1E4)
powerMCTests(mu, n, errfn="Normal",
parms=list(mean=0, sd=1),
test="kwManyOneDunnTest", p.adjust.method = "bonferroni",
replicates=1E4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.