montecarlo {rPowerSampleSize}R Documentation

Monte carlo computation of power.

Description

This function approximates the power for a given sample size using a Monte Carlo simulation.

Usage

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)

Arguments

method

"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.

M

number of Monte Carlo repetitions. Dmitrienko et al. (2013) suggested to take M = 10 ^ 5.

nE

integer. Sample size for the experimental (test) group.

r

integer, r = 1, ..., m. Desired number of endpoints to be declared significant.

m

integer. Number of endpoints.

nCovernE

ratio of nC over nE.

muC

vector of length m of the true means of the control group for all endpoints under the alternative hypothesis.

muE

vector of length m of the true means of the experimental (test) group for all endpoints under the alternative hypothesis.

d

vector of length m indicating the true value of the differences in means under the null hypothesis.

SigmaE

matrix indicating the covariances between the m primary endpoints in the experimental (test) group. See Details.

SigmaC

matrix indicating the covariances between the m primary endpoints in the control group. See Details.

alpha

a value which corresponds to the chosen q-gFWER type-I control bound.

q

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.

nbcores

number of cores to use for the computations.

alternative

NOT USED YET. Character string specifying the alternative hypothesis, must be one of "two.sided", "greater" or "less".

orig.Hochberg

logical. To use the standard Hochberg's procedure.

Value

rpowBonf or rpowHoch or rpowHolm

List with one element giving the computed power.

Author(s)

P. Lafaye de Micheaux, B. Liquet and J. Riou

References

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.

See Also

indiv.analysis,


[Package rPowerSampleSize version 1.0.2 Index]