plotSafeTDesignSampleSizeProfile {safestats} | R Documentation |
Plots the Sample Sizes Necessary for a Tolerable Alpha and Beta as a Function of deltaMin
Description
For given tolerable alpha and beta, (1) the planned sample sizes to using a safe test, (2) the frequentist test, and (3) the average sample size necessary due to optional stopping are plotted as a function of the minimal clinically relevant standardised effect size deltaMin.
Usage
plotSafeTDesignSampleSizeProfile(
alpha = 0.05,
beta = 0.2,
nMax = 100,
lowDeltaMin = 0.1,
highDeltaMin = 1,
stepDeltaMin = 0.1,
testType = c("oneSample", "paired", "twoSample"),
alternative = c("twoSided", "greater", "less"),
ratio = 1,
nSim = 1000L,
nBoot = 1000L,
seed = NULL,
pb = TRUE,
freqPlot = FALSE,
...
)
Arguments
alpha |
numeric in (0, 1) that specifies the tolerable type I error control –independent of n– that the designed test has to adhere to. Note that it also defines the rejection rule e10 > 1/alpha. |
beta |
numeric in (0, 1) that specifies the tolerable type II error control necessary to calculate both the sample sizes and deltaS, which defines the test. Note that 1-beta defines the power. |
nMax |
numeric, the maximum number of samples one has budget for to collect data. |
lowDeltaMin |
numeric, lowest value for deltaMin of interest |
highDeltaMin |
numeric, largest value for deltaMin of interest |
stepDeltaMin |
numeric, step size between lowDeltaMin and highDeltaMin |
testType |
either one of "oneSample", "paired", "twoSample". |
alternative |
a character string specifying the alternative hypothesis must be one of "twoSided" (default), "greater" or "less". |
ratio |
numeric > 0 representing the randomisation ratio of condition 2 over condition 1. If testType is not equal to "twoSample", or if nPlan is of length(1) then ratio=1. |
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. |
seed |
integer, seed number. |
pb |
logical, if |
freqPlot |
logical, if |
... |
further arguments to be passed to or from methods, but mainly to perform do.calls. |
Value
Returns a list that contains the planned sample size needed for the frequentist and safe tests as a function of the minimal clinically relevant effect sizes. The returned list contains at least the following components:
- alpha
the tolerable type I error provided by the user.
- beta
the tolerable type II error provided by the user.
- maxN
the largest number of samples provided by the user.
- deltaDomain
vector of the domain of deltaMin.
- allN1PlanFreq
vector of the planned sample sizes needed for the frequentist test corresponding to alpha and beta.
- allN1PlanSafe
vector of the planned sample sizes needed for the safe test corresponding to alpha and beta.
- allDeltaS
vector of safe test defining deltaS.
Examples
plotSafeTDesignSampleSizeProfile(nSim=1e2L)