View source: R/newsafe2x2Test.R
| sampleStoppingTimesSavi2x2 | R Documentation |
Draws nSim streams of tables on the curve thetaA = thetaB + |propDiffMin| for "greater", thetaA = thetaB - |propDiffMin| for
"less", and on both curves for "twoSided", at the worst-case
baseline of each curve from solveWorstCaseTheta2x2PropDiff(), and
records when the plain grow e-process first crosses 1 / alpha.
nPlan is the worst power quantile of the stopping time over the
curves; with power = NULL it is skipped. There is no planning on
logOdds.
sampleStoppingTimesSavi2x2(
propDiffMin,
na,
nb,
power = NULL,
alpha = 0.05,
alternative = c("twoSided", "less", "greater"),
eType = c("grow"),
nSim = 1000L,
nMax = 10000L,
nBoot = 10000L,
seed = NULL,
wantEValuesAtNMax = FALSE,
wantSamplePaths = FALSE,
wantSimData = TRUE,
pb = TRUE
)
propDiffMin |
numeric in (-1, 1) that defines the minimal relevant
difference in proportions |
na |
number of observations in group A per data block, one value or one per block. |
nb |
number of observations in group B per data block, one value or one per block. |
power |
numeric in (0, 1) that specifies the desired power, that is, the targetted chance to stop in favour of the alternative over the null hypothesis, when the alternative holds true. |
alpha |
numeric in (0, 1) that specifies the tolerable type I error and the null rejection rule e >= 1/alpha. |
alternative |
a character string specifying the alternative hypothesis. Must be one of "twoSided" (default), "greater" or "less", where "greater" means that group A has the larger proportion. |
eType |
"grow", the only e-variable with planning. |
nSim |
integer > 0, the number of simulations needed to compute power or the number of samples paths for the savi 2x2 test under continuous monitoring. |
nMax |
integer > 0, maximum number of data blocks in each sample path. |
nBoot |
integer > 0, the number of bootstrap samples; not used by
the sampler itself, see |
seed |
integer, seed number. Default seed=NULL yields seed=2026. |
wantEValuesAtNMax |
logical. If |
wantSamplePaths |
logical, if |
wantSimData |
logical. If |
pb |
logical, if |
a list with thetaA, thetaB (one per curve) and, one row per
curve, stoppingTimes and breakVector. Entries of breakVector are
0, 1. A 1 represents stopping due to exceeding nMax, which implies
that the corresponding stopping time is Inf, and 0 due to 1/alpha
threshold crossing. Further eValuesStopped, samplePaths (a list of
nSim x nMax sparse matrices, or NULL), n1Vector (the block
index), nPlan, and the baseline it was taken at, worstCaseThetaA,
worstCaseThetaB.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.