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 output is an indirect comparison that is both connected and population-adjusted.
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 disconnected network can be bridged only if the shared components
make the component effects identifiable, that is
,
the number of components. cpaic_connectivity() detects the
sub-networks, lists the bridging components, and reports
identifiability.
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
#> 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 a target population. On the link scale,
so the treatment coefficient
is the population-adjusted contrast at the target (the interaction term
vanishes at
).
This is the anchored generalization of regression-based standardization;
it is implemented natively because mlumr::stc() targets the
unanchored two-trial case.
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"))
#> 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 distribution matches the target population, 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.
fit_maic <- cmaic(net_ipd, target = c(x1 = 0), effect_modifiers = "x1",
n_boot = 100, seed = 1)
effective_sample_size(fit_maic)
#> S3 S4
#> 207.4202 358.1461The unification
For a single IPD edge anchored on a common comparator, combining the adjusted contrast with the aggregate comparator contrast through the component model is exactly a Bucher indirect comparison. The component model generalizes this to a network: many adjusted and unadjusted contrasts are combined simultaneously through , and the bridge supplies the contrasts that are otherwise unavailable across the disconnection. The key assumption is that component effects (and their effect-modifier interactions) are constant across 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. 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.
# Requires cmdstanr; see ?cmlnmr.
fit <- cmlnmr(ipd, agd, effect_modifiers = "x1", inactive = "Placebo",
family = "binomial")
component_effects(fit)Assumptions and caveats
-
Additivity of component effects (test with
additivity_test(); add interaction terms if violated). -
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.
- Non-collapsibility: MAIC targets a marginal effect and STC a conditional effect, so for noncollapsible measures they answer slightly different questions.