View source: R/getOptimalConditionalError.R
getOptimalConditionalError | R Documentation |
Calculate the Optimal Conditional Error
getOptimalConditionalError(firstStagePValue, design)
firstStagePValue |
First-stage p-value or p-values. Must be a numeric vector between 0 and 1. |
design |
An object of class |
The optimal conditional error \alpha_2
given a first-stage p-value p_1
is calculated as:
\alpha_2(p_1)=\psi(-e^{c_0} \cdot \frac{\Delta_1^2}{l(p_1)}).
The level constant c_0
as well as the specification of the effect size \Delta_1
and the likelihood ratio l(p_1)
must be contained in the design
object (see ?getDesignOptimalConditionalErrorFunction
).
Early stopping rules are supported, i.e., for p_1 \leq \alpha_1
, the returned conditional error is 1 and for p_1 > \alpha_0
, the returned conditional error is 0.
Value of the optimal conditional error function.
Brannath, W. & Bauer, P. (2004). Optimal conditional error functions for the control of conditional power. Biometrics. https://www.jstor.org/stable/3695393
getDesignOptimalConditionalErrorFunction()
# Create a design
design <- getDesignOptimalConditionalErrorFunction(
alpha = 0.025, alpha1 = 0.001, alpha0 = 0.5, conditionalPower = 0.9,
delta1 = 0.5, firstStageInformation = 40, useInterimEstimate = FALSE,
likelihoodRatioDistribution = "fixed", deltaLR = 0.5)
# Calculate optimal conditional error
getOptimalConditionalError(
firstStagePValue = c(0.1, 0.2, 0.3), design = design
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.