computeBetaSafeZ {safestats} | R Documentation |
Helper function: Computes the type II error based on the minimal clinically relevant mean difference and nPlan
Description
Helper function: Computes the type II error based on the minimal clinically relevant mean difference and nPlan
Usage
computeBetaSafeZ(
meanDiffMin,
nPlan,
alpha = 0.05,
alternative = c("twoSided", "greater", "less"),
sigma = 1,
kappa = sigma,
testType = c("oneSample", "paired", "twoSample"),
parameter = NULL,
pb = TRUE,
nSim = 1000L,
nBoot = 1000L
)
Arguments
meanDiffMin |
numeric that defines the minimal relevant mean difference, the smallest population mean that we would like to detect. |
nPlan |
optional numeric vector of length at most 2. When provided, it is used to find the safe test defining parameter phiS. Note that if the purpose is to plan based on nPlan alone, then both meanDiffMin and beta should be set to NULL. |
alpha |
numeric in (0, 1) that specifies the tolerable type I error control –independent on n– that the designed test has to adhere to. Note that it also defines the rejection rule e10 > 1/alpha. |
alternative |
a character string specifying the alternative hypothesis must be one of "twoSided" (default), "greater" or "less". |
sigma |
numeric > 0 representing the assumed population standard deviation used for the test. |
kappa |
the true population standard deviation. Default kappa=sigma. |
testType |
either one of "oneSample", "paired", "twoSample". |
parameter |
optional test defining parameter. Default set to |
pb |
logical, if |
nSim |
integer > 0, the number of simulations needed to compute power or the number of samples paths for the safe z test under continuous monitoring. |
nBoot |
integer > 0 representing the number of bootstrap samples to assess the accuracy of approximation of the power, the number of samples for the safe z test under continuous monitoring, or for the computation of the logarithm of the implied target. |
Value
a list which contains at least beta and an adapted bootObject of class boot
.
Examples
computeBetaSafeZ(meanDiffMin=0.7, 20, nSim=10)