computeNPlanBatchSafeT {safestats}R Documentation

Helper function: Computes the planned sample size for the safe t-test based on the minimal clinically relevant standardised effect size, alpha and beta.

Description

Helper function: Computes the planned sample size for the safe t-test based on the minimal clinically relevant standardised effect size, alpha and beta.

Usage

computeNPlanBatchSafeT(
  deltaMin,
  alpha = 0.05,
  beta = 0.2,
  alternative = c("twoSided", "greater", "less"),
  testType = c("oneSample", "paired", "twoSample"),
  lowN = 3,
  highN = 1e+06,
  ratio = 1
)

Arguments

deltaMin

numeric that defines the minimal relevant standardised effect size, the smallest effect size that we would the experiment to be able to detect.

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.

alternative

a character string specifying the alternative hypothesis must be one of "twoSided" (default), "greater" or "less".

testType

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

lowN

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

highN

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

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.

Value

a list which contains at least nPlan and the phiS the parameter that defines the safe test


[Package safestats version 0.8.7 Index]