This function approximates the power for a given sample size using a Monte Carlo simulation.
montecarlo(method, M = 100000, nE, r, m, nCovernE = 1, muC,
muE, d = rep(0.0, m), SigmaE, SigmaC, alpha =
0.05, q = 1, nbcores = parallel::detectCores() - 1, alternative =
"greater",
orig.Hochberg = FALSE)
"Bonferroni", "Holm" or "Hochberg". When method =
"Hochberg"
, we use critical values involving the D1 term in formula
(11) of Romano et al. in order to control strongly the \(q\)-FWER.
If you want to use the original Hochberg's
procedure, set orig.Hochberg
to TRUE
. Even for
\(q=1\), this is a bad idea except when the p-values can be assumed independent.
number of Monte Carlo repetitions. Dmitrienko et al. (2013)
suggested to take M = 10 ^ 5
.
integer. Sample size for the experimental (test) group.
integer, r = 1, ..., m. Desired number of endpoints to be declared significant.
integer. Number of endpoints.
ratio of nC
over nE
.
vector of length m
of the true means of the control
group for all endpoints under the alternative hypothesis.
vector of length m
of the true means of the experimental (test) group for all endpoints under the alternative hypothesis.
vector of length m
indicating the true value of the differences in means
under the null hypothesis.
matrix indicating the covariances between the m
primary endpoints in the experimental (test) group. See Details.
matrix indicating the covariances between the m
primary endpoints in the control group. See Details.
a value which corresponds to the chosen q-gFWER type-I control bound.
integer. Value of 'q' (q = 1, ..., m) in the q-gFWER of Romano et
al., which is the probability to make at least q
false
rejections. The default value q=1
corresponds to the classical FWER control.
number of cores to use for the computations.
NOT USED YET. Character string specifying the alternative hypothesis, must be one of "two.sided", "greater" or "less".
logical. To use the standard Hochberg's procedure.
List with one element giving the computed power.
Delorme P., Lafaye de Micheaux P., Liquet B., Riou, J. (2015). Type-II Generalized Family-Wise Error Rate Formulas with Application to Sample Size Determination. Submitted to Statistics in Medicine.
Romano J. and Shaikh A. (2006) Stepup Procedures For Control of Generalizations of the Familywise Error Rate. The Annals of Statistics, 34(4), 1850--1873.