sampleStoppingTimesSafeT {safestats}R Documentation

Simulate stopping times for the safe z-test

Description

Simulate stopping times for the safe z-test

Usage

sampleStoppingTimesSafeT(
  deltaTrue,
  alpha = 0.05,
  alternative = c("twoSided", "less", "greater"),
  testType = c("oneSample", "paired", "twoSample"),
  nSim = 1000L,
  nMax = 1000,
  ratio = 1,
  lowN = 3L,
  parameter = NULL,
  seed = NULL,
  wantEValuesAtNMax = FALSE,
  pb = TRUE
)

Arguments

deltaTrue

numeric, the value of the true standardised effect size (test-relevant parameter). This argument is used by 'designSafeT()' with 'deltaTrue <- deltaMin'

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".

testType

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

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.

lowN

integer minimal sample size of the (first) sample when computing the power due to optional stopping. Default lowN is set 1.

parameter

optional test defining parameter. Default set to NULL.

seed

integer, seed number.

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

sampleStoppingTimesSafeT(0.7, nSim=10)

[Package safestats version 0.8.7 Index]