Research use only. cpaic is experimental. Its methodology and implementation have not been validated for clinical, regulatory, reimbursement, or other decision use.
This vignette describes the statistical framework behind cpaic. The companion mathematical-foundations document (shipped with the development sources) gives the full derivations; here we summarize the model and show how each piece maps to a function.
Two layers
cpaic targets networks that are disconnected: the treatments split into two or more sub-networks with no common comparator, so standard network meta-analysis cannot compare across the gap. Two layers solve the two distinct problems.
- Connection layer (component network meta-analysis). Multi-component treatments are decomposed into additive component effects. When sub-networks share components, the component effects bridge the gap.
- Adjustment layer (population adjustment). Where individual patient data (IPD) are available, each evidence edge is corrected for between-study imbalance in effect modifiers, using anchored STC, MAIC, or ML-NMR.
The component model can identify a cross-gap contrast, but scientific transportability is an additional assumption. A two-stage result is not a coherent single-target population adjustment when target-specific IPD contrasts are mixed with retained AgD contrasts from their original study populations.
The additive component model
Let
be the vector of observed relative effects (one per comparison),
the edge-incidence (contrast) matrix mapping comparisons to treatments,
and
the treatment-by-component matrix with
if treatment
contains component
.
Treatment effects are additive in the component effects
,
with
the component design matrix. With inverse-variance weights
,
the component effects are estimated by weighted least squares
where
is the Moore-Penrose inverse and
the data vector (Rücker et al. 2020). The
additivity assumption is checked with a Cochran
statistic. This is implemented in cnma_bridge(), a wrapper
around netmeta::discomb().
Connecting a disconnected network
A full set of component effects is identifiable when
,
the number of components. Even in a rank-deficient design, a particular
contrast can be identifiable when its contrast vector lies in the row
space of
.
cpaic_connectivity() detects the sub-networks and reports
the component-design diagnostics; estimable_effects()
checks the requested contrasts.
net <- cpaic_network(cpaic_bin_agd, sm = "OR", inactive = "Placebo")
cpaic_connectivity(net)
#> cpaic connectivity
#> Connected network: FALSE
#> Sub-networks: 2
#> [1] 3 treatments
#> [2] 3 treatments
#> Bridging components: A, B
#> (components that OCCUR in more than one sub-network; occurrence is
#> not identifiability, homogeneity, or influence for any contrast.)
#> Component design: rank(X) = 4 / 4 components -> all component effects identified
#> Estimable effects: 5 / 5 vs PlaceboWhen identifiable, cnma_bridge() reconstructs the
relative effects across the gap from the component effects.
component_effects(cnma_bridge(net))
#> component estimate se lower upper statistic pval
#> 1 A 0.5000000 1.1922140 -1.836697 2.836697 0.4193878 0.6749328
#> 2 B 0.4000000 1.1922140 -1.936697 2.736697 0.3355102 0.7372402
#> 3 C 0.7170248 0.9734562 -1.190914 2.624964 0.7365763 0.4613800
#> 4 D 0.3250136 0.9728622 -1.581761 2.231788 0.3340798 0.7383193Anchored simulated treatment comparison (cSTC)
For each IPD study, cstc() fits an outcome regression
with treatment main effects, prognostic main effects, and
treatment-by-effect-modifier interactions, with the effect modifiers
centered at supplied target covariate means. On the link scale,
so the treatment coefficient
is the conditional link-scale contrast at the supplied target covariate
means (the interaction term vanishes at
).
Because this contrast is linear in the effect modifiers on the link
scale, it is also the average conditional link-scale contrast at those
means. It is not an outcome-scale marginal standardization. The model is
implemented natively.
net_ipd <- cpaic_network(cpaic_bin_agd, ipd = cpaic_bin_ipd, sm = "OR",
family = "binomial", ipd_covariates = "x1",
inactive = "Placebo")
component_effects(cstc(net_ipd, target = c(x1 = 0),
effect_modifiers = "x1",
allow_experimental_bridge = TRUE))
#> Warning: cstc() cannot form a decision-grade component bridge:
#> - retained aggregate-only edge(s) remain in their own study populations: S1: A vs Placebo; S2: B vs Placebo; S5: A+B+C vs A+B+D
#> Use cmlnmr() for a joint model, restrict the analysis to a design in which every edge is adjusted and the estimand is additive, or set `allow_experimental_bridge = TRUE` only for explicitly exploratory sensitivity work.
#> component estimate se lower upper statistic pval
#> 1 A 0.5000000 0.2563324 -0.002402322 1.0024023 1.950592 0.051105590
#> 2 B 0.4000000 0.2563324 -0.102402322 0.9024023 1.560474 0.118647988
#> 3 C 0.4896667 0.2406290 0.018042458 0.9612910 2.034944 0.041856471
#> 4 D 0.6408956 0.2317142 0.186744196 1.0950470 2.765889 0.005676788Anchored matching-adjusted indirect comparison (cMAIC)
cmaic() reweights each IPD study so that its
effect-modifier moments match the supplied target moments, using
entropy-balancing weights
with
the centered effect modifiers (Phillippo et al. 2020). The effective
sample size is
.
The weighted within-study contrasts, with bootstrap standard errors that
propagate the weighting uncertainty, are then combined through the
component model.
That last step is an additional methodology constraint. A marginal weighted contrast is not generally additive across treatment components on a nonlinear link scale. Also, if AgD-only edges remain, those contrasts still refer to their original study populations. cMAIC therefore stops by default outside the Gaussian identity-link case and whenever retained AgD edges would be mixed in. The experimental override does not repair either estimand mismatch.
fit_maic <- cmaic(net_ipd, target = c(x1 = 0), effect_modifiers = "x1",
n_boot = 100, seed = 1,
allow_experimental_bridge = TRUE)
#> Warning: cmaic() cannot form a decision-grade component bridge:
#> - retained aggregate-only edge(s) remain in their own study populations: S1: A vs Placebo; S2: B vs Placebo; S5: A+B+C vs A+B+D
#> - cMAIC estimates marginal binomial contrasts, which are not generally additive in the component design on a nonlinear link scale
#> Use cmlnmr() for a joint model, restrict the analysis to a design in which every edge is adjusted and the estimand is additive, or set `allow_experimental_bridge = TRUE` only for explicitly exploratory sensitivity work.
effective_sample_size(fit_maic)
#> S3 S4
#> 207.4202 358.1461The unification
For a single anchored comparison, the contrast algebra resembles a Bucher indirect comparison. A network bridge combines many adjusted and unadjusted contrasts through . That algebra does not establish that every input contrast shares the same target estimand. It also does not test the required constancy of component effects and effect-modifier interactions across disconnected sub-networks (Rücker et al. 2021).
Component-additive ML-NMR
cmlnmr() places the component structure inside
multilevel network meta-regression: the relative effect of an arm is
rather than a free per-treatment parameter, and aggregate arms are
fitted by integrating the individual model over each study’s covariate
distribution. Disconnected sub-networks share the component parameters,
so the network is connected by construction. All four outcome families
are supported; survival uses a proportional-hazards model with a
flexible baseline (piecewise-exponential by default, or a smooth
M-spline), set through cut_points and
baseline. Its analytic row-level likelihood handles events,
right/left/interval censoring, and delayed entry. Aggregate survival
arms require reconstructed event and censoring rows; event counts plus
person-time are rejected. The finite quasi-Monte Carlo covariate
integration is approximate. Aggregate covariates are integrated with a
Gaussian copula whose correlation is estimated from the individual
patient data. A component whose effect-modifier interaction is informed
only by aggregate data is weakly identified and relies on the regression
prior.
The default reporting path evaluates
at a one-row vector of supplied covariate means. Since this expression
is linear in
,
it is an average conditional link-scale effect at those means. A
separate marginal_effects() path accepts empirical target
rows or a named Gaussian-copula target distribution. Empirical rows must
contain exactly the fitted effect modifiers; finite nonnegative weights
are normalized and zero-weight rows are discarded. Bernoulli modifiers
use actual 0/1 rows. Summary targets provide named means, SDs, and
margins, with optional latent-scale correlation and deterministic Sobol’
integration. Continuous modifiers can use normal, gamma, lognormal, or
beta margins independently, while fitted Bernoulli modifiers remain
Bernoulli. Independent Bernoulli strata are enumerated exactly. Summary
integration stops when the requested Bernoulli strata or non-normal
moments fail their moment-fidelity gates, rather than silently reporting
a distorted target. The Bernoulli prevalence tolerance is
max(1e-8, 0.1 * min(p, 1 - p)); non-normal means must be
within 0.1 target SD and non-normal SDs within 15 percent relative
error. Mixed or non-normal multivariable targets also require resolved
pairwise correlations to agree within 0.05 of a high-resolution
deterministic reference grid.
The estimator averages treatment-specific outcomes within each posterior draw before forming odds, risk, rate, survival, time-specific hazard, or restricted mean survival time contrasts. Binomial, rate-difference, and survival measures require an explicit donor study intercept or baseline hazard. Survival predictions start at model time zero and are not landmark or delayed-entry conditioned. Prediction times must remain within the observed follow-up support of the selected donor study. Survival and risk ratios, piecewise-exponential RMST ratios, and time-specific marginal hazard ratios are formed on the log scale with stable log-sum-exp calculations before optional back-transformation. RMST measures require a piecewise-exponential donor baseline and are evaluated analytically over its intervals. M-spline fits support marginal survival, risk, and time-specific marginal hazard measures, but not RMST. These target checks are not a formal overlap or positivity diagnostic. Nonlinear marginal effects remain treatment-level contrasts, not marginal component effects or rankings.
# Fits with rstan by default; backend = "cmdstanr" is the alternative.
fit <- cmlnmr(ipd, agd, effect_modifiers = "x1", inactive = "Placebo",
family = "binomial")
component_effects(fit)
# Marginal risk ratio over an empirical target distribution.
marginal_effects(
fit, target = data.frame(x1 = c(0, 1)), weights = c(0.7, 0.3),
measure = "risk_ratio", baseline_study = "study_id"
)Assumptions and caveats
-
Additivity of component effects.
additivity_test()can diagnose lack of fit where evidence exists, but it cannot validate an unobserved cross-gap bridge. -
Identifiability: a disconnected network is
bridgeable only when
cpaic_connectivity()reportsidentifiable = TRUE. - Cross-population transportability of effect modifiers (the standard population-adjustment assumption), here extended to constancy of component effects across sub-networks.
- Two-stage estimand mixing: retained AgD contrasts remain tied to their study populations. The default gate stops this mixed bridge unless the caller explicitly opts into research-only behavior.
- Nonlinearity and non-collapsibility: MAIC targets a marginal weighted contrast and STC a conditional link-scale contrast. Marginal contrasts are not generally component-additive on nonlinear links.
- cML-NMR reporting: average conditional effects at covariate means and marginal effects over target distributions are separate estimands. Marginal standardization is treatment-level and does not preserve component additivity on nonlinear scales. Measures requiring absolute outcomes transport a selected study intercept or baseline hazard. Survival predictions start at model time zero, not a landmark or delayed-entry time, and use the donor study’s observed follow-up support. No formal overlap diagnostic is estimated.