Skip to content

BCompare groups · Guide test 293

O’Brien–Fleming group sequential procedure

Uses stringent early boundaries that relax toward the final planned analysis.

Runs in CodeSplashPython (calls R) example not runR example not run

Do it in CodeSplash

In the app, set it up in Analyze with this method:

In Sequential monitoring — group-sequential boundaries and always-valid p-values, choose Efficacy bounds = O'Brien–Fleming (classical c / √t).

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · O'Brien–Fleming group sequential procedure

30

Three equally spaced looks at accumulating data (known SD 1).

0.30
0.050

Your data

Data accumulate over three looks
3.472.452.00

The trial stops at the first look whose |z| reaches its boundary; later looks (faded) would not have happened.

If H₀ were true

z_sw = 2.37
  1. The reference: how z_sw varies across samples when H₀ is true (stagewise ordering: earlier crossings count as more extreme; shown as the z with the same two-sided p (O'Brien–Fleming)).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .018).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

bk=c tkΔ−1/2,∑kP0(∣Zj∣<bj (j<k), ∣Zk∣≥bk)=α,Δ=0b_k=c\,t_k^{\Delta-1/2},\qquad \sum_kP_0\big(|Z_j|<b_j\ (j<k),\ |Z_k|\ge b_k\big)=\alpha,\quad \Delta=0

With your numbers

b=(3.47,2.45,2.00),stopped at look 3 (z=2.71),zsw=2.37b = (3.47, 2.45, 2.00),\quad \text{stopped at look } 3\ (z = 2.71),\quad z_{sw} = 2.37
tkt_k
information fraction at look k (1/3, 2/3, 1)
Δ\Delta
the boundary shape: ½ Pocock, 0 O'Brien–Fleming, in between Wang–Tsiatis
zswz_{sw}
the stagewise-ordering p-value written as a z, the value shown on the reference

The verdict

z at look 3 = 2.71, z = 2.37, p = .018

p ≤ α = .050: reject H₀

Very strict early boundaries keep the final look close to the fixed-design critical value; early stops need overwhelming evidence.

Statistic
2.372
p-value
0.0177
O'Brien–Fleming group sequential procedure on three looks after 30, 60 and 90 observations: z at look 3 = 2.71, z = 2.37, p = .018. The p-value is below α = .050, so the data are hard to reconcile with H0.

O'Brien–Fleming group sequential procedure on three looks after 30, 60 and 90 observations: z at look 3 = 2.71, z = 2.37, p = .018. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: the treatment/effect parameter equals its null value across sequential looks.

Assumptions

A prespecified group-sequential design with valid approximately Gaussian score increments; information times, sidedness, maximum sample size and stopping boundaries specified. Standard joint null correlation is Corr(Zi,Zj)=√(Ii/Ij) for i≤j.

Formula

bj=c/tjb_j=c/\sqrt{t_j}

Parameters and notation

O’Brien–Fleming uses information fraction tj=Ij/IK; c is solved using the joint normal crossing probability. Early boundaries are stringent.

Structure of the method

Solve a jointly calibrated boundary family proportional to inverse square root of information fraction. Early standardized thresholds are high and decrease toward the final analysis. The constant is determined by the full correlated sequence, not by applying a fixed 1.96 cutoff independently at each look.

Estimated and nuisance parameters

The design solver produces boundary values and information/sample-size inflation. Underlying effect estimates, nuisance variances and realized information are fitted during the trial. The shape constant is not learned from favorable observed interim effects, and a planned information fraction differs from calendar time.

Settings and design choices

Prespecify alpha, power, effect target, look times, maximum information and futility handling. The baseline gsDesign alpha=.025 is a one-sided input for a symmetric two-sided design. Distinguish the original O’Brien–Fleming boundary shape from a spending function designed to resemble it.

Fitting and adaptation

Calibrate the whole design before monitoring and use supported methods for changed information times or sample-size adaptation. A new outcome model needs valid standardized increments and information calculations. There is no neural fine-tuning; simulation under null and alternative can check the proposed implementation’s operating characteristics.

Sensitivity and robustness

Very early stopping requires strong evidence, while later thresholds stay nearer conventional fixed-sample values than Pocock thresholds. Unexpected dependence, delayed outcomes, overrun and small-sample approximations can affect errors and bias. Report stopping-adjusted estimates/intervals and the actual monitoring path rather than unadjusted fixed-sample conclusions alone.

How to use and calibrate

Use multivariate normal integration or a validated design algorithm to calibrate all boundaries jointly. Alpha-spending analogues handle actual information timing but must be identified separately.

Example application

Preserve a near-conventional final threshold while allowing early stopping for strong evidence.

Interpretation and pitfalls

Watch out

These are stopping-boundary families, not different outcome models. Ordinary unadjusted intervals and p values after early stopping may mislead.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

Three-look symmetric two-sided design; gsDesign alpha=.025 is the one-sided upper-tail rate, yielding .05 overall. Wang–Tsiatis delta=.25 lies between O’Brien–Fleming and Pocock shapes. These are design boundaries, not observed-data p-values.

Python · invokes R

Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: gsDesign

# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
    raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
design<-gsDesign::gsDesign(k=3,test.type=2,alpha=.025,beta=.2,sfu="OF")
print(design)
print(data.frame(look=1:3,information=design$n.I,upper_z=design$upper$bound,lower_z=design$lower$bound))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
                        text=True, capture_output=True)
print(result.stdout)
if result.stderr:
    print(result.stderr)
result.check_returncode()
R

Not run — Syntax checked; runtime not verified in the final environment · needs gsDesign

design<-gsDesign::gsDesign(k=3,test.type=2,alpha=.025,beta=.2,sfu="OF")
print(design)
print(data.frame(look=1:3,information=design$n.I,upper_z=design$upper$bound,lower_z=design$lower$bound))

Sources

Statistics guide v4 (historical):
Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 293, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT293.