designPilotSafeZ {safestats}R Documentation

Designs a Safe Z-Test Based on Planned Samples nPlan

Description

Designs a safe experiment for a prespecified tolerable type I error based on planned sample size(s), which are fixed ahead of time. Outputs a list that includes phiS, i.e., the safe test defining parameter.

Usage

designPilotSafeZ(
  nPlan,
  alternative = c("twoSided", "greater", "less"),
  alpha = 0.05,
  sigma = 1,
  h0 = 0,
  kappa = sigma,
  tol = 1e-05,
  paired = FALSE,
  parameter = NULL
)

Arguments

nPlan

optional numeric vector of length at most 2. When provided, it is used to find the safe test defining parameter phiS. Note that if the purpose is to plan based on nPlan alone, then both meanDiffMin and beta should be set to NULL.

alternative

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

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.

sigma

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

h0

numeric, represents the null hypothesis, default h0=0.

kappa

the true population standard deviation. Default kappa=sigma.

tol

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

paired

logical, if TRUE then paired z-test.

parameter

optional test defining parameter. Default set to NULL.

Value

Returns a 'safeDesign' object

nPlan

the sample size(s) to plan for. Provided by the user.

parameter

the safe test defining parameter. Here phiS.

esMin

NULL no minimally clinically relevant effect size provided.

alpha

the tolerable type I error provided by the user.

beta

NULL, no tolerable type II error specified.

alternative

any of "twoSided", "greater", "less" provided by the user.

testType

any of "oneSample", "paired", "twoSample" effectively provided by the user.

paired

logical, TRUE if "paired", FALSE otherwise.

sigma

the assumed population standard deviation used for the test provided by the user.

kappa

the true population standard deviation, typically, sigma=kappa.

ratio

default is 1. Different from 1, whenever testType equals "twoSample", then it defines ratio between the planned randomisation of condition 2 over condition 1.

tol

the step size between parameter values in the candidate space.

pilot

logical, specifying whether it's a pilot design.

call

the expression with which this function is called.

Examples

designPilotSafeZ(nPlan=30, alpha = 0.05)

[Package safestats version 0.8.7 Index]