Skip to content

BCompare groups · Guide test 294

Wang–Tsiatis group sequential family

Provides a parameterized family of interim testing boundaries containing Pocock and O’Brien–Fleming designs.

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 = Wang–Tsiatis (Δ family).

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 · Wang–Tsiatis group sequential family

30

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

0.30
0.050

Your data

Data accumulate over three looks
2.742.312.08

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.21
  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 (Wang–Tsiatis, Δ = 0.25)).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .027).
  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)=α,Δ=0.25b_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.25

With your numbers

b=(2.74,2.31,2.08),stopped at look 3 (z=2.71),zsw=2.21b = (2.74, 2.31, 2.08),\quad \text{stopped at look } 3\ (z = 2.71),\quad z_{sw} = 2.21
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.21, p = .027

p ≤ α = .050: reject H₀

Δ moves the boundaries between O'Brien–Fleming (0) and Pocock (½). Choose it before the trial; the boundaries are a design, not a statistic of the data.

Statistic
2.206
p-value
0.0274
Wang–Tsiatis group sequential family on three looks after 30, 60 and 90 observations: z at look 3 = 2.71, z = 2.21, p = .027. The p-value is below α = .050, so the data are hard to reconcile with H0.

Wang–Tsiatis group sequential family on three looks after 30, 60 and 90 observations: z at look 3 = 2.71, z = 2.21, p = .027. 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 tjΔ−1/2b_j=c\,t_j^{\Delta-1/2}

Parameters and notation

Δ is a prespecified shape parameter; Δ=0 gives O’Brien–Fleming shape and Δ=1/2 gives Pocock shape. c enforces overall α.

Structure of the method

Choose a power-law boundary shape b_j=c t_j^(Δ−1/2) and solve c using the joint Gaussian crossing probability over planned looks. Δ=0 yields O’Brien–Fleming shape and Δ=1/2 Pocock shape; the family parameter changes the allocation of evidence requirements over information time.

Estimated and nuisance parameters

Δ, target errors and timing are user design choices. The calibrated constant and maximum information are numerical design outputs. Treatment effects and nuisance variances belong to the outcome model; none of these quantities are neural weights or predictive-model hyperparameters.

Settings and design choices

Prespecify Δ rather than optimizing it after interim results. Evaluate expected sample size, early stopping probabilities and maximum information over plausible alternatives. State sidedness and futility assumptions. In the baseline gsDesign call, sfupar=.25 selects an intermediate shape and alpha=.025 is the one-sided budget.

Fitting and adaptation

Adaptation means recalibrating a planned boundary design with a valid method when information schedules or constraints change. Do not sweep Δ after observing the path and retain the first rejecting boundary. Validate numerical integration and outcome-model approximations through independent simulations when the design is unusual.

Sensitivity and robustness

Nearby shapes can have different early/late power and stopping distributions despite the same overall alpha. Incorrect information fractions or treating repeated Z values as independent defeats calibration. Separate exact boundary-family language from spending-function analogues, and report post-stopping inference compatible with the design used.

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

Choose a planned compromise between early and late evidence requirements.

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="WT",sfupar=.25)
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="WT",sfupar=.25)
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 294, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT294.