sampleStoppingTimesSafeZ {safestats}R Documentation

Simulate stopping times for the safe z-test

Description

Simulate stopping times for the safe z-test

Usage

sampleStoppingTimesSafeZ(
  meanDiffMin,
  alpha = 0.05,
  alternative = c("twoSided", "less", "greater"),
  sigma = 1,
  kappa = sigma,
  nSim = 1000L,
  nMax = 1000,
  ratio = 1,
  testType = c("oneSample", "paired", "twoSample"),
  parameter = NULL,
  wantEValuesAtNMax = FALSE,
  pb = TRUE
)

Arguments

meanDiffMin

numeric that defines the minimal relevant mean difference, the smallest population mean that we would like to detect.

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.

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.

nMax

integer > 0, maximum sample size of the (first) sample in each sample path.

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.

testType

either one of "oneSample", "paired", "twoSample".

parameter

optional test defining parameter. Default set to NULL.

wantEValuesAtNMax

logical. If TRUE then compute eValues at nMax. Default FALSE.

pb

logical, if TRUE, then show progress bar.

Value

a list with stoppingTimes and breakVector. Entries of breakVector are 0, 1. A 1 represents stopping due to exceeding nMax, and 0 due to 1/alpha threshold crossing, which implies that in corresponding stopping time is Inf.

Examples

sampleStoppingTimesSafeZ(0.7, nSim=10)

[Package safestats version 0.8.7 Index]