designPilotSafeT {safestats} | R Documentation |
Designs a Safe T-Test Based on Planned Samples nPlan
Description
Designs a safe experiment for a prespecified tolerable type I error based on planned sample size(s), which are fixed ahead of time. Outputs a list that includes the deltaS, i.e., the safe test defining parameter.
Usage
designPilotSafeT(
nPlan = 50,
alpha = 0.05,
alternative = c("twoSided", "greater", "less"),
h0 = 0,
lowParam = 0.01,
highParam = 1.2,
tol = 0.01,
inverseMethod = TRUE,
logging = FALSE,
paired = FALSE,
maxIter = 10
)
Arguments
nPlan |
the planned sample size(s). |
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. |
alternative |
a character string specifying the alternative hypothesis must be one of "twoSided" (default), "greater" or "less". |
h0 |
a number indicating the hypothesised true value of the mean under the null. For the moment h0=0. |
lowParam |
numeric defining the smallest delta of the search space for the test-defining deltaS for scenario 3. Currently not yet in use. |
highParam |
numeric defining the largest delta of the search space for the test-defining deltaS for scenario 3. Currently not yet in use. |
tol |
a number that defines the stepsizes between the lowParam and highParam. |
inverseMethod |
logical, always |
logging |
logical, if |
paired |
logical, if |
maxIter |
numeric > 0, the maximum number of iterations of adjustment to the candidate set from lowParam to highParam, if the minimum is not found. |
Value
Returns an object of class 'safeDesign'. An object of class 'safeDesign' is a list containing at least the following components:
- nPlan
the planned sample size(s).
- parameter
the safe test defining parameter. Here deltaS.
- esMin
the minimal clinically relevant standardised effect size provided by the user.
- alpha
the tolerable type I error provided by the user.
- beta
the tolerable type II error provided by the user.
- alternative
any of "twoSided", "greater", "less" provided by the user.
- testType
any of "oneSample", "paired", "twoSample" provided by the user.
- paired
logical,
TRUE
if "paired",FALSE
otherwise.- h0
the specified hypothesised value of the mean or mean difference depending on whether it was a one-sample or a two-sample test.
- ratio
default is 1. Different from 1, whenever testType equals "twoSample", then it defines ratio between the planned randomisation of condition 2 over condition 1.
- lowN
the smallest n of the search space for n provided by the user.
- highN
the largest n of the search space for n provided by the user.
- lowParam
the smallest delta of the search space for delta provided by the user.
- highParam
the largest delta of the search space for delta provided by the user.
- tol
the step size between lowParam and highParam provided by the user.
- pilot
FALSE
(default) specified by the user to indicate that the design is not a pilot study.- call
the expression with which this function is called.
Examples
designPilotSafeT(nPlan=30)