Learn R Programming

safestats (version 0.8.7)

computeNPlanBatchSafeZ: Helper function: Computes the planned sample size based on the minimal clinical relevant mean difference, alpha and beta.

Description

Helper function: Computes the planned sample size based on the minimal clinical relevant mean difference, alpha and beta.

Usage

computeNPlanBatchSafeZ(
  meanDiffMin,
  alpha = 0.05,
  beta = 0.2,
  sigma = 1,
  kappa = sigma,
  alternative = c("twoSided", "greater", "less"),
  testType = c("oneSample", "paired", "twoSample"),
  tol = 1e-05,
  highN = 1e+06,
  ratio = 1,
  parameter = NULL,
  grow = TRUE
)

Value

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

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.

beta

numeric in (0, 1) that specifies the tolerable type II error control necessary to calculate both "n" and "phiS". Note that 1-beta defines the power.

sigma

numeric > 0 representing the assumed population standard deviation used for the test.

kappa

the true population standard deviation. Default kappa=sigma.

alternative

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

testType

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

tol

a number that defines the stepsizes between the lowParam and highParam.

highN

integer that defines the largest n of our search space for n. This might be the largest n that we are able to fund.

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.

parameter

optional test defining parameter. Default set to NULL.

grow

logical, default set to TRUE so the grow safe test is used in the design.