Docs/Composed Pipeline T1E

Composed Pipeline Type I Error Simulator

Pipeline-level Type I error simulator for two-arm Phase II oncology designs that combine four design components — historical borrowing (MAP prior) plus three adaptive mechanisms: Bayesian sequential monitoring, sample-size re-estimation (SSR), and response-adaptive randomization (Thompson Sampling). The engine is a Python port of the canonical R reference implementation underlying Qian (2026, JSM); the calculator page ships one-click presets that run the paper's composite-null sweep, its fixed-threshold ablations, and the departure × time-trend crossing.

Calibrating at one point does not control error across the null.

An efficacy threshold γ\gamma^* is typically calibrated at a single assumed control rate. But H0H_0 is composite: it holds wherever both arms share a common response process, not only at that anchor. Along the constant-rate equality boundary (common baseline rate pp, no time trend, so every point is a genuine null and every rejection is a Type I error), Type I error rises with pp, reaching 0.2786 at p=0.45p = 0.45 against a nominal 0.025. Holding γ\gamma^* fixed and switching SSR and RAR off does not restore control either (0.2020 at the same point). A separate trend-active slice is reported by the paper as rejection probabilitiesrather than Type I error, because a shared drift breaks the constant-rate estimand. Each component passed its reported numerical benchmark check, but none of those checks evaluated Type I error away from the calibration anchor.

1. When to Use This Calculator

Use this calculator to explore two-arm, binary-endpoint Phase II designs that combine two or more of the following supported design components:

  • Historical borrowing: a MAP (meta-analytic predictive) or robustified-mixture prior on the control arm, fitted from one or more historical cohorts.
  • Bayesian sequential monitoring: interim posterior probability tests P(pe>pcdata)γP(p_e > p_c \mid \text{data}) \ge \gamma^*evaluated at one or more pre-specified looks.
  • Sample-size re-estimation (SSR): blinded re-estimation of NfinalN_{\text{final}} at an interim look using pooled response data, capped at NmaxN_{\max}.
  • Response-adaptive randomization (RAR): Thompson Sampling allocation that shifts treatment assignment toward the arm with the higher current posterior.

Single-mechanism designs are well-served by the existing calculators (Bayesian Borrowing, Bayesian Sequential, SSR Blinded/Unblinded/ Single-Arm, Adaptive Randomization). This calculator is purpose-built for the composed case. The claim there is deliberately narrow and purely negative: calibrating each component under its own marginal model, and the composed rule at a single null point, places no constraint on the error rate of the composed rule elsewhere in the null. That is a statement about what those checks fail to establish — not a theorem that composition must inflate error, and not a claim that shared information implies failure. Whether error control breaks, in which direction, and by how much are empirical questions, which is why this is a simulation. The FDA's January 2026 draft guidance recommends (as non-binding recommendations in a draft) documenting operating characteristics under realistic simulation scenarios and pre-specifying how prior–data conflict will be handled.

2. Design Class & Mechanisms

2.1 Trial structure

Two-arm Phase II oncology design with binary endpoint (e.g., ORR). The default schedule mirrors the JSM 2026 reference design: monitoring looks at n{30,45,60,90}n \in \{30, 45, 60, 90\}, planned final at nbase=90n_{\text{base}} = 90, cap at Nmax=150N_{\max} = 150, and SSR firing at n=45n = 45 via blinded pooled response. Treatment and control arms accrue concurrently; allocation is either fixed 1:1 alternation (when RAR is off) or Thompson Sampling after a 10-patient burn-in (when RAR is on).

2.2 MAP prior

Method background: Bayesian Historical Borrowing (MAP priors, robustification, prior-data conflict).

The control prior is a Beta mixture

πc(p)=iwiBeta(ai,bi)\pi_c(p) = \sum_{i} w_i \cdot \mathrm{Beta}(a_i, b_i)

fitted with RBesT from the historical cohorts (n=50,40,60n = 50, 40, 60; response rates 26%, 25%, 25%; pooled 38/150 = 0.2533), giving the three-component default w=0.5887, Beta(18.403,53.273)w = 0.5887,\ \mathrm{Beta}(18.403, 53.273); w=0.2113, Beta(1.956,4.703)w = 0.2113,\ \mathrm{Beta}(1.956, 4.703); and a flat robustifying w=0.2000, Beta(1,1)w = 0.2000,\ \mathrm{Beta}(1, 1). Mixture weights are updated at each interim via the log marginal likelihood. The treatment-arm posterior uses an independent Jeffreys prior — historical borrowing applies only to control.

The reference rate is ambiguous, so name it explicitly. The threshold is calibrated at the design anchor p0=0.25p_0 = 0.25, which is not the mean of any prior in play: the dominant informative component has mean 0.2568, the full robustified mixture has mean 0.3132, and the historical pooled rate is 0.2533. Describe p>0.25p > 0.25 as departure of the baseline rate from the calibration anchor, never as “kk percentage points above the prior mean.”

2.3 Bayesian monitoring

Method background: Bayesian Sequential Monitoring (posterior-probability stopping rules).

At each scheduled look the calculator computes

P(pe>pcdata)P(p_e > p_c \mid \text{data})

by deterministic Gauss–Legendre quadrature (400 nodes) as fe(x)Fc(x)dx\int f_e(x) F_c(x)\,dx, where fef_e is the Jeffreys treatment posterior density and FcF_c the control posterior mixture CDF. Stop for efficacy if this posterior probability exceeds γ\gamma^*. Quadrature replaced an earlier 2,000-draw Monte Carlo estimate: the monitoring rule takes a maximum over interim looks, so Monte Carlo noise inflates that maximum and identical trial data could otherwise yield different decisions. The default γ=0.96566\gamma^* = 0.96566 comes from a grid-free binary search with the blinded nuisance SSR active, and gives in-sample T1E = 0.0248 (MCSE 0.0011, N=20,000N = 20{,}000) at the design anchor p0=0.25p_0 = 0.25 with no trend. Note this is in-sample calibration: the search targets the empirical calibration sample exactly, not the population Type I error, so out-of-sample behaviour is unverified.

2.4 Blinded SSR

Method alignment: Blinded SSR and this composed pipeline now use the same core principle: re-estimate a binary nuisance level from blinded pooled outcomes while holding the planned treatment effect fixed. This is consistent with the binary internal-pilot framework of Friede–Kieser (2004). The implementation here remains a conventional-style working rule embedded in a different pipeline: its planning calculation assumes 1:1 allocation, whereas the simulated trial can use Thompson-sampling RAR and a Bayesian posterior-probability final decision. Its reference Wald power is therefore not the exact power of the full composed design.

At nssr,trign_{\text{ssr,trig}} the pooled response count xpool=xe+xcx_{\text{pool}} = x_e + x_c definesp^pool\hat p_{\text{pool}}. With planned effectΔ=0.20\Delta = 0.20, working rates are imposed symmetrically around the blinded estimate:

ε=106,p~c=p^poolΔ2,pc,w=clip(p~c;ε,1Δε),pe,w=pc,w+Δ.\begin{aligned} \varepsilon &= 10^{-6}, \\[2pt] \widetilde p_c &= \hat p_{\mathrm{pool}}-\frac{\Delta}{2}, \\[2pt] p_{c,w} &= \operatorname{clip}(\widetilde p_c;\,\varepsilon,\,1-\Delta-\varepsilon), \\[2pt] p_{e,w} &= p_{c,w}+\Delta. \end{aligned}

The target is not an arbitrary 80% conditional-power threshold. It is the one-sided fixed-sample Wald power implied by the originalN=90N=90 design at (pc,pe)=(0.25,0.45)(p_c,p_e)=(0.25,0.45), which is 0.5296. The recalculated working 1:1 total is

Vw=pc,w(1pc,w)+pe,w(1pe,w),nw,arm=(z1α+zpower)2VwΔ2,Nwork=2nw,arm.\begin{aligned} V_w &= p_{c,w}(1-p_{c,w}) \\ &\quad + p_{e,w}(1-p_{e,w}), \\[3pt] n_{w,\mathrm{arm}} &= \left\lceil \frac{(z_{1-\alpha}+z_{\mathrm{power}})^2 V_w}{\Delta^2} \right\rceil, \\[3pt] N_{\mathrm{work}} &= 2n_{w,\mathrm{arm}}. \end{aligned}

and Nfinal=min{Nmax,max(Nbase,Nwork)}N_{\mathrm{final}}=\min\{N_{\max},\max(N_{\mathrm{base}},N_{\mathrm{work}})\}. Only (xpool,nint)(x_{\mathrm{pool}},n_{\mathrm{int}})enters the rule; arm labels, arm-specific outcomes, posterior probabilities, and the realized allocation ratio do not. At the default n=45n=45 look, exhaustive evaluation of all pooled counts maps to final N=90N=90through 100.

2.5 Response-Adaptive Randomization

Method background: Adaptive Randomization (Thompson sampling, DBCD, Neyman, Pocock–Simon).

Thompson Sampling: at each enrollment after a 10-patient burn-in, sample one Beta variate from each arm's posterior and allocate to whichever variate is larger. This is the canonical TS reference implementation; it converges toward complete allocation to the better arm (a fundamentally different limit from the Rosenberger DBCD target).

2.6 Time trend

Linear drift on a fixed per-patient scale anchored to the planned horizon: parm(t)=parm,base+δtp_{\text{arm}}(t) = p_{\text{arm,base}} + \delta \cdot t with t=i/(nbase1)t = i / (n_{\text{base}} - 1). Both arms drift in parallel under H0, so the data-generating null is preserved. Coupling RAR with this drift can create allocation imbalance that affects the final analysis, although the experiment does not isolate an RAR-specific trend channel.

Note tt is not capped at 1: when SSR extends enrollment past nbasen_{\text{base}} drift keeps accruing at the same per-patient rate, which is intended — a longer trial spans more calendar time. (A trial expanded to n=100n = 100 accrues total drift 0.05×99/890.0560.05 \times 99/89 \approx 0.056, not 0.05.) Only the resulting probability is clamped to [0,1][0, 1]. Dividing by the re-estimated sample size instead would make normalized time jump backward the moment SSR fires, an SSR-induced artifact.

3. JSM Presets & What They Show

Each preset on the calculator runs a multi-scenario batch corresponding to a table in the JSM paper.

Section 3.3 — Composite-null sweep

The primary result. Holds the trend fixed at δ=0.05\delta = 0.05 and varies the common baseline rate pp from 0.20 to 0.36, running each point twice: with all mechanisms active, and with SSR and RAR disabled at the same fixed γ\gamma^*.

  • On the constant-rate boundary T1E rises from 0.0058 at p=0.20p = 0.20 to 0.2786 at p=0.45p = 0.45.
  • With SSR and RAR off, T1E still runs 0.0298 → 0.2020 — disabling the adaptive components does not restore control.
  • The fixed-γ\gamma^* difference reverses sign, from −0.0224 at p=0.20p = 0.20 to +0.0634 at p=0.36p = 0.36.

No row in this table is the calibration scenario — the p=0.25p = 0.25 row shares the anchor rate but carries the trend, so it should not be read against 0.0250 as though the trend were held fixed.

Section 3.5 — Departure × Time Trend

A 2×2 crossing baseline-rate departure from the anchor (p{0.25,0.30}p \in \{0.25, 0.30\}) with time trend (δ{0,0.05}\delta \in \{0, 0.05\}), all four mechanisms active. Both factors independently raise the rejection probability; their joint effect is close to the additive prediction rather than exceeding it:

Δinteraction=T1EbothT1EdepartureT1Etrend+T1Eneither.\begin{aligned} \Delta_{\mathrm{interaction}} &= \mathrm{T1E}_{\mathrm{both}} - \mathrm{T1E}_{\mathrm{departure}} \\ &\quad - \mathrm{T1E}_{\mathrm{trend}} + \mathrm{T1E}_{\mathrm{neither}}. \end{aligned}

Paper values: anchor 0.0232, departure only 0.0904, trend only 0.0474, both 0.1140 — against an additive prediction of 0.1146, giving a departure × trend interaction of Δinteraction=0.0006\Delta_{\text{interaction}} = -0.0006, essentially additive. Do not confuse this with the SSR × RAR interaction, a different contrast whose pooled manuscript estimate is −0.0077 (SE 0.0041; 95% SI [−0.0157, +0.0002]) — pooled across two seed blocks, so it is not recoverable from the four displayed factorial cells alone, which on their own imply −0.0240. The paper draws no directional conclusion from either. Because all four cells use the full design, they share a common calibrated baseline and the contrasts are internally consistent. This is a risk-difference interaction at the specific factor levels evaluated, not a scale-free mechanistic claim.

Section 3.4 — SSR × RAR fixed-threshold ablation

Four designs at p=0.30p = 0.30 with the trend active: SSR + RAR disabled (borrowing + monitoring; 0.1120), + SSR (0.1248), + RAR (0.1236), + both (0.1124). These four cells on their own imply an SSR × RAR interaction of −0.0240. The manuscript instead reports the pooled estimate across two seed blocks, −0.0077 (SE 0.0041; 95% SI [−0.0157, +0.0002]), combining that run with a higher-precision replicate at −0.0037. The interval touches zero and the paper draws no directional conclusion; the pooled value cannot be recovered from the four displayed cells alone.

These are ablations, not a decomposition. γ\gamma^* was calibrated with SSR and RAR active, and every ablation cell retains that threshold, so none of them is calibrated to α — with SSR and RAR disabled the monitoring rule already returns ≈0.05 at the anchor before any departure or trend. Read these rows as “does switching this component off restore control?”, never as “how much of the excess did this component cause?” Attribution would require separately calibrating each design.

Do not over-interpret the point estimate. The current result replaces the one computed under the earlier conditional-power SSR rule. Both the propagated simulation interval and the fresh-seed validation include zero. The factorial is useful as a fixed-threshold sensitivity analysis, but it does not establish a stable SSR×RAR interaction or an attributable contribution from either mechanism.

4. Interpreting Results

4.1 The estimand

On the constant-rate boundary — pe=pcp_e = p_c with no time trend — the reported rejection rate is the frequentist Type I error rate, not a posterior predictive error rate conditional on prior beliefs. When a shared trend is active the rate over calendar time is no longer constant, so the manuscript reports those cells as rejection probabilities rather than Type I error. The prior–data conflict scenarios are realistic situations where the historical prior is misspecified relative to the current trial population, but H0 still holds in the current data. The inflation we report is the false-positive rate under the current trial's data-generating null — the regulatory-relevant quantity, not a Bayesian robustness diagnostic.

4.2 Monte Carlo uncertainty

The simulator reports the rejection rate, its binomial Monte Carlo standard error MCSE=p^(1p^)/Nsim\text{MCSE} = \sqrt{\hat p (1 - \hat p) / N_{\text{sim}}}, and a 95% Wald CI. At Nsim=5,000N_{\text{sim}} = 5{,}000 with p^0.08\hat p \approx 0.08, MCSE ≈ 0.0038 and the CI half-width is about ±0.0075. To halve MCSE, run at Nsim=20,000N_{\text{sim}} = 20{,}000 in the Advanced panel.

4.3 How this engine compares to the paper's R runs

The paper's reference numbers were generated in R (Mersenne Twister PRNG); this calculator is a Python/NumPy (PCG64) port. Same seed values give different streams, so a single-seed run drifts by a few MCSE even when two engines are mathematically equivalent. The calculator presets are pinned to the final published design and compare each run with the manuscript value using the combined Monte Carlo uncertainty from both simulations. Treat a few-MCSE single-seed discrepancy as a prompt to increase replications and compare independent seeds, not as deterministic non-reproduction.

Two details of the reference implementation matter enough to call out, because getting either wrong shifts results in trend-active scenarios specifically. First, calendar drift accrues on a fixed per-patient scale anchored to the planned horizon. If the denominator tracked the re-estimated sample size instead, normalized time would jump backward the moment SSR fired and the response probability would fall — an artifact induced by SSR that contaminates both the SSR effect and the departure × trend interaction. Second, the monitoring posterior is computed by deterministic quadrature, not Monte Carlo: because the monitoring rule takes a maximum over interim looks, MC noise inflates that maximum and identical trial data could otherwise yield different decisions.

4.4 Interaction term

When the Departure × Trend 2×2 preset finishes, the calculator displays Δinteraction\Delta_{\text{interaction}} below the results table. A positive value would mean the joint effect exceeds the sum of the independent contributions. The paper's departure × trend reference value is −0.0006 — essentially additive. (The separate SSR × RAR interaction, pooled across two seed blocks, is −0.0077 with SE 0.0041; the paper draws no directional conclusion from either.)

Two caveats attach. It is a risk-difference interaction at the specific factor levels evaluated, not a scale-free mechanistic claim. And because drift is anchored to the planned horizon nbase=90n_{\text{base}} = 90, a trial expanded to n=100n = 100 accrues total drift of about 0.056 rather than 0.05 — so the interaction includes the extra secular-trend exposure created by extending enrollment, not only a mechanism interaction.

5. Assumptions & Limitations

  • Two-arm, binary endpoint. Continuous and survival are on the roadmap but not implemented in v1; the JSM paper itself is binary-only.
  • Blinded SSR with pooled response. The calculator uses aggregate counts at the SSR look (the "single-arm in the sense that SSR uses only aggregate counts, not treatment-arm allocation" phrasing from the paper). Unblinded treatment-arm-specific SSR is not modeled.
  • Thompson Sampling RAR only. DBCD, Neyman, and other allocation rules are not exposed in this calculator. Use the dedicated RAR calculator for those.
  • MAP prior is pre-pooled. The prior is supplied as a set of (wi,ai,bi)(w_i, a_i, b_i) mixture components via prior_components. To fit a MAP prior from historical cohort data, use the Bayesian Borrowing calculator first and copy the fitted hyperparameters across.
  • Linear time trend only. Sigmoidal, step, or non-linear trends would require code changes.
  • The supremum is not estimated. A grid exhibits points at which control fails and establishes that the supremum of the Type I error is at least the largest value observed (0.2786, at the upper grid boundary, where the curve was still rising). It does not locate the worst case.
  • The SSR rule is a working nuisance calculation. It uses blinded pooled outcomes and a prespecified 1:1 planning allocation, while the full design may realize unequal Thompson- sampling allocation and uses Bayesian monitoring. This makes the SSR operationally blinded, but its preserved Wald power is not the exact power of the composed analysis. Results remain conditional on the chosen planned effect and working model.
  • Calibration is in-sample. The binary search targets the empirical calibration sample exactly; out-of-sample behaviour is unverified.

6. API Reference

POST /api/v1/calculators/composed-pipeline— runs one scenario.

Request body (key fields)

  • use_borrowing, use_monitoring, use_ssr, use_rar — bool toggles for each mechanism
  • p_control, p_treatment, time_trend_delta — data-generating scenario
  • n_base, n_cap, n_ssr_trig, monitoring_looks, gamma, planned_effect — design
  • prior_components — MAP prior as [weight, a, b] triples (weights sum to 1)
  • simulate, n_simulations, simulation_seed — Monte Carlo control

Response (key fields)

  • simulation.estimates.rejection_rate — pipeline-level rejection rate; it is Type I error only when the scenario is on the constant-rate boundary (equal arms, time_trend_delta = 0)
  • simulation.estimates.monte_carlo_se, ci_95_lower, ci_95_upper
  • analytical_results.mechanisms_active — design summary
  • analytical_results.reference_power, operational_n_min, operational_n_max — SSR diagnostics

The endpoint returns 400 on invalid scenario combinations (e.g.,n_ssr_trig >= n_base), and 500 on internal simulation failures. Pro subscription required.

7. References

  1. Qian L. Point Calibration Does Not Control Type I Error Across the Composite Null in a Composed Adaptive Bayesian Design. Joint Statistical Meetings 2026 Proceedings, August 2026. Zenodo. doi.org/10.5281/zenodo.22018687 (The source paper for this calculator.)
  2. Weber S, Li Y, Seaman JW III, Kakizume T, Schmidli H. Applying meta-analytic-predictive priors with the R Bayesian evidence synthesis tools (RBesT). Journal of Statistical Software. 2021;100(19):1-32. (Source of the three-component MAP prior fit.)
  3. Berry SM, Broglio KR, Groshen S, Berry DA. Bayesian hierarchical modeling of patient subpopulations: Efficient designs of Phase II oncology clinical trials. Clinical Trials. 2013;10(5):720-734.
  4. Mehta CR, Pocock SJ. Adaptive increase in sample size when interim results are promising: A practical guide with examples. Statistics in Medicine. 2011;30(28):3267-3284.
  5. Friede T, Kieser M. Blinded sample size re-estimation in non-inferiority and equivalence trials. Pharmaceutical Statistics. 2004;3(4):269-279. doi: 10.1002/pst.140. (Binary blinded nuisance-parameter re-estimation framework underlying the SSR rule used here.)
  6. Kieser M, Friede T. Simple procedures for blinded sample size adjustment that do not affect the type I error rate. Statistics in Medicine. 2003;22(23):3571-3581.
  7. Hu F, Zhang LX. Asymptotic properties of doubly adaptive biased coin designs for multitreatment clinical trials. Annals of Statistics. 2004;32(1):268-301.
  8. Schmidli H, et al. Robust meta-analytic-predictive priors in clinical trials with historical control information. Biometrics. 2014;70(4):1023-1032.
  9. U.S. Food and Drug Administration. Use of Bayesian Methodology in Clinical Trials of Drug and Biological Products: Draft Guidance for Industry. January 12, 2026.
  10. U.S. Food and Drug Administration. Adaptive Designs for Clinical Trials of Drugs and Biologics: Guidance for Industry. November 2019.

Last updated: August 2026

Ready to stress-test your composed design?

Use our Composed Pipeline T1E Simulator for pipeline-level Type I error under prior-data conflict and time-trend scenarios for designs that compose borrowing, monitoring, SSR, and RAR.

Open Composed Pipeline T1E Simulator