Signature
alpha_OF = 2 - 2 * Phi(Phi^-1(1 - alpha / 2) / sqrt(t))
| Inputs | Definition | Unit |
|---|---|---|
alpha | Overall one-sided significance level of the trial, for example 0.025 | probability |
t | Information fraction at which the spend is evaluated | proportion, above 0 and up to 1 |
alpha_OF | Cumulative one-sided type I error that may have been used by information fraction t | probability from 0 to alpha |
|---|
Function
Alpha spending function for group sequential trials
Maps the information fraction reached at an analysis of a group sequential trial to the cumulative one-sided type I error that may have been used by that point. The function rises from zero at the start of the trial to the overall significance level at the planned end. Each efficacy boundary is then set so that the probability, under the null hypothesis, of crossing any boundary up to and including analysis k equals the cumulative spend, with correlation sqrt(t_l / t_k) between the test statistics at analyses l and k. That step needs recursive numerical integration and is done in group sequential software, so the records here cover the closed-form parts: the information fraction, the two Lan-DeMets spending functions, the increment available at each look and the hazard ratio that crosses a given boundary.
Computational function
Computational function: alpha spent and stopping hazard ratio at a group sequential look
Takes the counts a trial report gives, deaths at the current and previous looks and the planned final deaths, with the overall one-sided level and the critical value at the look, and returns the cumulative alpha spent under both Lan-DeMets functions, the increment at the look and the hazard ratio needed to stop. It chains HE-FM-ASP-001, HE-FM-ASP-002, HE-FM-ASP-003, HE-FM-ASP-004 and HE-FM-ASP-005. The critical value is an input because, from the second look onwards, it comes from recursive numerical integration over the joint normal distribution of the test statistics, which a spreadsheet formula cannot do; the function computes only the closed-form parts.
Inputs and outputs:
d_k: Deaths observed at this look; required, above zero. Unit: events.;d_prev: Deaths at the previous look, 0 at the first look; required, from 0 up to d_k. Unit: events.;D: Deaths planned for the final analysis; required, at least d_k. Unit: events.;alpha: Overall one-sided significance level; required, for example 0.025. Unit: probability.;c_k: Efficacy critical value at this look for the chosen plan, from group sequential software such as gsDesign; at the first look it equalsNORM.S.INV(1-alpha_k)for the chosen function's cumulative spend. Unit: standard normal deviate.;t_k,t_prev: Information fractions at this and the previous look. Unit: proportion.;alpha_OF_k,alpha_P_k: Cumulative spend by this look under the O'Brien-Fleming type and Pocock type functions. Unit: probability.;inc_OF_k,inc_P_k: Increments available at this look under each function. Unit: probability.;HR_k: Largest observed hazard ratio that crosses the boundary c_k. Unit: ratio.Assumption: Deaths measure information, with 1:1 allocation and proportional hazards, and the one-sided level is halved inside the O'Brien-Fleming type quantile. The O'Brien-Fleming type spend at a fraction of 0 is taken as 0.
Worked example (Second look of the O'Brien-Fleming type plan): At 200 of 400 deaths, after a first look at 100, with the O'Brien-Fleming type critical value of 2.963, the function returns the article's look 2 figures.
d_k = 200; d_prev = 100; D = 400; alpha = 0.025; c_k = 2.963; t_k = 0.5; t_prev = 0.25; alpha_OF_k = 0.001525; alpha_P_k = 0.015503; inc_OF_k = 0.001518; inc_P_k = 0.006569; HR_k = 0.658Worked example (First look of the Pocock type plan): At 100 deaths, with no earlier look and the Pocock type critical value of 2.368, each increment equals the cumulative spend.
d_k = 100; d_prev = 0; D = 400; alpha = 0.025; c_k = 2.368; t_k = 0.25; t_prev = 0; alpha_OF_k = 0.0000074; alpha_P_k = 0.008934; inc_OF_k = 0.0000074; inc_P_k = 0.008934; HR_k = 0.623Worked example (Final analysis of the O'Brien-Fleming type plan): At 400 deaths both functions have spent the full 0.025, and the final O'Brien-Fleming type critical value of 2.014 needs an observed hazard ratio of about 0.818.
d_k = 400; d_prev = 300; D = 400; alpha = 0.025; c_k = 2.014; t_k = 1; t_prev = 0.75; alpha_OF_k = 0.025; alpha_P_k = 0.025; inc_OF_k = 0.015351; inc_P_k = 0.004300; HR_k = 0.818Excel:
=Deaths/PlannedDeaths; =2-2*NORM.S.DIST(NORM.S.INV(1-Alpha/2)/SQRT(Deaths/PlannedDeaths),TRUE); =Alpha*LN(1+(EXP(1)-1)*Deaths/PlannedDeaths); =SpendOF-IF(PrevDeaths=0,0,2-2*NORM.S.DIST(NORM.S.INV(1-Alpha/2)/SQRT(PrevDeaths/PlannedDeaths),TRUE)); =SpendP-Alpha*LN(1+(EXP(1)-1)*PrevDeaths/PlannedDeaths); =EXP(-2*CritValue/SQRT(Deaths))Six cells returning t_k, alpha_OF_k (named SpendOF), alpha_P_k (named SpendP), inc_OF_k, inc_P_k and HR_k, from named cells Deaths, PrevDeaths, PlannedDeaths, Alpha and CritValue. The IF avoids a division by zero at the first look.R:
alpha_spend_look <- function(d_k, d_prev, D, alpha, c_k) { of <- function(t) ifelse(t == 0, 0, 2-2*pnorm(qnorm(1-alpha/2)/sqrt(t))); po <- function(t) alpha*log(1+(exp(1)-1)*t); t_k <- d_k/D; t_prev <- d_prev/D; data.frame(t_k = t_k, alpha_OF_k = of(t_k), alpha_P_k = po(t_k), inc_OF_k = of(t_k)-of(t_prev), inc_P_k = po(t_k)-po(t_prev), HR_k = exp(-2*c_k/sqrt(d_k))) }Base R only; vectorised, so vectors of deaths and critical values give one row per look. Exact boundaries for later looks come from gsDesign, for example gsDesign(k = 4, test.type = 1, sfu = sfLDOF).Python:
def alpha_spend_look(d_k, d_prev, D, alpha, c_k): N = NormalDist(); z = N.inv_cdf(1-alpha/2); of = lambda t: 0.0 if t == 0 else 2-2*N.cdf(z/math.sqrt(t)); po = lambda t: alpha*math.log(1+(math.e-1)*t); t_k, t_prev = d_k/D, d_prev/D; return t_k, of(t_k), po(t_k), of(t_k)-of(t_prev), po(t_k)-po(t_prev), math.exp(-2*c_k/math.sqrt(d_k))Needs import math and from statistics import NormalDist (standard library). Returns t_k, alpha_OF_k, alpha_P_k, inc_OF_k, inc_P_k and HR_k for one look.Test (Both functions spend the full level at the final analysis): With Deaths equal to PlannedDeaths, both cumulative spends equal alpha. Expected result: TRUE. Excel check:
=AND(ABS(2-2*NORM.S.DIST(NORM.S.INV(1-Alpha/2)/SQRT(PlannedDeaths/PlannedDeaths),TRUE)-Alpha)<1E-9,ABS(Alpha*LN(1+(EXP(1)-1)*PlannedDeaths/PlannedDeaths)-Alpha)<1E-12)Test (First-look Pocock type boundary matches the published value): The only boundary available in closed form is the first one, the normal quantile of the first spend. Expected result: TRUE, matching 2.368 in the article and 2.368328 in the gsDesign manual. Excel check:
=ROUND(NORM.S.INV(1-0.025*LN(1+(EXP(1)-1)*0.25)),3)=2.368Common error (Taking later boundaries as the normal quantile of the increment): At the second Pocock type look the increment is 0.006569, and its normal quantile is about 2.480, but the correct boundary is 2.368. The shortcut ignores the first look and the correlation between looks, so the boundary is too strict and part of the budget is never used. Boundaries after the first look have to come from software that integrates the joint distribution.
Source: Anderson KM. gsDesign Technical Manual, chapter 8.1 (spending function definitions). Gives the Lan-DeMets O'Brien-Fleming type and Pocock type functions and prints the Pocock type spend and bounds for four equally spaced looks at alpha of 0.025.
t_k = d_k / D; t_prev = d_prev / D; alpha_OF_k = 2 - 2 * Phi(Phi^-1(1 - alpha / 2) / sqrt(t_k)); alpha_P_k = alpha * log(1 + (exp(1) - 1) * t_k); inc_OF_k = alpha_OF_k - (2 - 2 * Phi(Phi^-1(1 - alpha / 2) / sqrt(t_prev))) for t_prev > 0; inc_OF_k = alpha_OF_k for t_prev = 0; inc_P_k = alpha_P_k - alpha * log(1 + (exp(1) - 1) * t_prev); HR_k = exp(-2 * c_k / sqrt(d_k))
Implementations
Excel
O'Brien-Fleming type cumulative spend in one cell
Excel uses NORM.S.INV for Phi^-1 and NORM.S.DIST with TRUE for Phi, on named cells holding the one-sided level and the information fraction.
=2-2*NORM.S.DIST(NORM.S.INV(1-Alpha/2)/SQRT(InfoFraction),TRUE)
Assumptions
One-sided alpha halved inside the O'Brien-Fleming type quantile
The function is written with alpha/2 inside the normal quantile, so with alpha set to the one-sided level it returns exactly alpha at t = 1. The trial tests for efficacy in one direction.
O'Brien-Fleming type boundaries solved numerically
The spend fixes the boundaries only through the joint normal distribution of the test statistics. At the first look the critical value is simply Phi^-1(1 minus alpha_OF(t_1)); from the second look onwards it is found by numerical integration in group sequential software.
Worked examples
O'Brien-Fleming type spend at a quarter of the information
With a one-sided level of 0.025, Phi^-1(0.9875) is 2.2414. Divided by the square root of 0.25, which is 0.5, it gives 4.4828, and 2 minus 2 Phi(4.4828) is about 0.0000074. The first boundary is then 4.333.
alpha = 0.025; t = 0.25; alpha_OF = 0.0000074
O'Brien-Fleming type spend at half the information
At t of 0.5 the cumulative spend is about 0.001525, still a small share of the 0.025 budget, as in the article's four-look example.
alpha = 0.025; t = 0.5; alpha_OF = 0.001525
Common errors
Using 1 minus alpha inside the O'Brien-Fleming type quantile
Writing Phi^-1(1 minus alpha) with alpha at the one-sided 0.025 makes the function reach 0.05 at t of 1, twice the planned budget, and every boundary is set too low.
Treating the spending function as the original O'Brien-Fleming bound
The Lan-DeMets function only approximates the original O'Brien-Fleming boundary, and less closely than the Pocock type function approximates the Pocock boundary. A protocol or appraisal should state which of the two was used, because the critical values differ.
Sources
O'Brien-Fleming type spending function formula in gsDesign
Anderson KM. gsDesign R package reference for sfLDOF and sfLDPocock (Lan-DeMets spending function approximations). Gives f(t; alpha) = 2 minus 2 Phi(Phi^-1(1 minus alpha/2)/t^(rho/2)), with rho = 1 for the O'Brien-Fleming approximation.
Lan-DeMets spending functions in the 1994 review
DeMets DL, Lan KKG. Interim analysis: the alpha spending function approach. Statistics in Medicine. 1994;13:1341-1352. Section on the alpha spending function, which lists the O'Brien-Fleming type and Pocock type functions and states that the final O'Brien-Fleming critical value is not substantially larger than the fixed sample value.
Accuracy of the Lan-DeMets O'Brien-Fleming approximation
Anderson KM. gsDesign Technical Manual, chapter 8.1 (spending function definitions), which compares the Lan-DeMets approximations with the original Pocock and O'Brien-Fleming bounds.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0