getQ: Calculate Q

View source: R/getQ.R

getQR Documentation

Calculate Q

Description

Calculate the ratio of likelihood ratio and squared effect size.

Usage

getQ(firstStagePValue, design)

Arguments

firstStagePValue

First-stage p-value or p-values. Must be a numeric vector between 0 and 1.

design

An object of class TrialDesignOptimalConditionalError created by getDesignOptimalConditionalErrorFunction(). Contains all necessary arguments to calculate the optimal conditional error function for the specified case.

Details

For more information on how to specify the likelihood ratio, see ?getLikelihoodRatio(). In case the optimal conditional error function is ever increasing in the first-stage p-value p_1, a monotone transformation of getQ() is needed for logical consistency and type I error rate control.
The formula for Q(p_1) is:

Q(p_1) = l(p_1) / \Delta_1^2,

where l(p_1) is the likelihood ratio and \Delta_1 is the effect size at which the conditional power should be achieved. The effect size may also depend on the interim data (i.e., on p_1) in case useInterimEstimate = TRUE was specified for the design object.

Value

Ratio of likelihood ratio and squared effect size.

References

Brannath, W., Dreher, M., zur Verth, J., Scharpenberg, M. (2024). Optimal monotone conditional error functions. https://arxiv.org/abs/2402.00814

Examples

# Get a design
design <- getDesignOptimalConditionalErrorFunction(
alpha = 0.025, alpha1 = 0.001, alpha0 = 0.5, conditionalPower = 0.9,
delta1 = 0.25, likelihoodRatioDistribution = "fixed", deltaLR = 0.25,
firstStageInformation = 80, useInterimEstimate = FALSE,
)

getQ(firstStagePValue = c(0.05, 0.1, 0.2), design = design)


optconerrf documentation built on Sept. 9, 2025, 5:29 p.m.