Chain Mediation When Patients Leave the Network

Many clinical questions are about how an effect happens, not only whether it happens. A drug intensification might lower blood sugar first, which slows kidney decline, which in turn prevents a later complication. Statisticians call this a chain, or serial, mediation: the treatment changes one intermediate step, and that step changes a second one before the outcome moves. Electronic health records (EHRs) should be the natural place to trace such chains, because they contain repeated lab values and hard outcomes for large populations. They also have a structural flaw. Patients get care at more than one institution, so any single hospital's records show only part of each patient's history. When a lab is missing because it was drawn at an outside clinic, standard mediation methods quietly drop that link, or fill it in as if nothing systematic were going on.

This note proposes that the link is often missing because of its own value. A patient whose kidney function worsens is referred to an outside nephrologist, and a patient whose sugar control fails switches to a specialist network. If so, the chain looks shorter or weaker inside one institution than it really is. We propose a simple test bed that measures this bias directly. A regional health information exchange links records across hospitals, so we can deliberately cut each patient's history down to what a single health system sees and compare chain estimates before and after the cut. We also propose an estimator for two-step mediation chains that treats "was this step recorded in-network" as its own variable. It recovers the missing step from signals that the departure leaves behind in the home system.

Core Claim

Serial mediation estimates computed from single-institution EHRs are biased in a predictable direction when the chance of observing an intermediate step depends on that step's value. This bias can be measured against a linked multi-system reference. It can be reduced by an estimator that extends proxy-based ("proximal") mediation from one hidden mediator to a two-step chain, where each step is hidden only for the patients whose care fragmented. What is new is the combination of an estimand for a chain with two mediators, an explicit model of the observation process driven by fragmentation, and an empirical check against ground truth obtained by truncating real linked records. No work in the file does any of the three.

How This Sits Against Prior Work

The chain-mediation literature supplies the motivating phenomenon, but it cannot address fragmentation. Studies of older adults with coronary heart disease (Pathways of influence on health-promoting lifestyles) and of heart failure patients (Fear of progression and quality of life) fit multi-step chains to cross-sectional questionnaires from a few hundred patients using serial regression. The authors themselves say they cannot establish temporal order and that they need objective markers and hard endpoints. Similar serial designs appear in geriatric well-being (family care and well-being) and in nursing management (ambidextrous leadership). All of these studies assume every mediator is measured for every participant. We keep their chain structure but move it into longitudinal records, where time order is observed and measurement is patchy.

Three causal-methods papers supply our techniques and also set our limits. Causal mediation analysis with one or multiple mediators benchmarks machine-learning estimators such as double machine learning for mediation (medDML) and releases the med_bench library. It reports that these estimators become unstable when some patient types rarely receive some mediator values, which is an overlap failure that fragmentation makes worse. It also treats several mediators as one joint vector, so it cannot separate the serial path. Proximal mediation analysis identifies mediated effects under unmeasured confounding by solving for "bridge functions" from two kinds of proxy variables, but only for a single mediator. Detecting clinician implicit biases using proximal causal inference applies the same idea to UK Biobank with a single latent health state and contributes practical tests of whether a proxy is valid, which we reuse. Our extension changes two things. The chain has two steps, and each mediator is hidden only for a subset of patients selected by fragmentation, not hidden for everyone.

The fragmentation literature supplies the failure mode and the data. Predicting onset of complications from diabetes documents that patient movement between systems in the Indiana Network for Patient Care (INPC) creates large gaps in trajectories, and it uses binned HbA1c and eGFR (estimated glomerular filtration rate, a kidney-function measure) to predict six complications. We borrow that clinical setting. Nonstationary Gaussian process regression for repeated lab tests shows that apparent undersampling is often care delivered elsewhere, and that sparse sampling makes volatile physiology look smooth. That result constrains how we define a mediator in time. Causal thinking for decision making on EHRs gives the target-trial discipline we adopt, including its warning about immortal-time bias. It treats intermediate variables only as things not to adjust for, while we treat them as the object of study. Total-effect EHR models such as Dynamic Survival Transformers and latent-confounder methods such as PriMeD do not decompose pathways, so they serve as reference points and are not direct competitors.

Research Program

The clinical chain is set in type 2 diabetes within INPC, matching the covariates used by the diabetes graph study. The treatment is a medication-intensification decision within a defined window after diagnosis. The first mediator is glycemic control, summarized as HbA1c over months 6 to 12. The second mediator is kidney trajectory, summarized as eGFR slope over months 12 to 24. The outcome is onset of a complication such as retinopathy or stroke after month 24. Emulating a target trial in the style of the causal-EHR paper fixes time zero and eligibility and avoids immortal time.

The target quantity is the interventional serial effect. This is the change in outcome risk when the treatment is set to one value and glycemic control is drawn from its distribution under the treated versus the untreated regime, but only as that control feeds into kidney trajectory. We choose this interventional version on purpose. With a direct edge from the first mediator to the outcome, the classical "natural" serial path effect runs into the recanting-witness problem and is not identified without cross-world assumptions. The interventional version is identified from observed-data distributions and is the natural longitudinal quantity.

For each mediator window we add an indicator $R_j$ for whether mediator $M_j$ was recorded in the home system. The key assumption departure is

$$P(R_j = 1 \mid M_j, H_j) \neq P(R_j = 1 \mid H_j),$$

where $H_j$ is the observed in-network history before window $j$. In words, whether the lab appears in-network depends on the lab's own value even after conditioning on everything seen so far. Standard inverse-probability-of-observation weighting assumes the two sides are equal.

To identify the effect despite this, we use two groups of in-network signals. The first group consists of signals that predict leaving the network but have no effect on physiology beyond the mediator. Examples are referral codes, insurance changes, and a gap in in-network visits. The second group consists of downstream in-network measurements that reflect the missing mediator's value. Examples are a later in-network eGFR, medication dose changes, and diagnosis codes coded on return. These play the roles of the two proxy families in Proximal mediation analysis. We derive bridge-function equations that hold separately for each step of the chain and compose them sequentially. Estimation follows that paper's multiply-robust construction, fitted with cross-fitted flexible learners as in med_bench. We run the proxy-validity diagnostics from the implicit-bias paper before trusting any real-data estimate.

Because fragmentation also creates overlap failures, the estimator reports the effective sample size for every weighting step. We pre-register a truncation rule, so that variance blow-ups are visible rather than hidden.

Baselines

The naive reference point is what the clinical literature does today. It fits a product-of-coefficients serial model, the regression chain used in the coronary and heart-failure studies, to patients with complete in-network mediator data, with bootstrap intervals. This tells us how wrong the default is.

The strongest existing competitor is a sequential doubly robust mediation estimator from the med_bench family (comparative study), adapted to the interventional serial effect and combined with inverse-probability-of-observation weights that assume missingness depends only on observed history. This is the method a careful causal-inference group would build today, and it is fully correct if fragmentation is missing at random. It is also the most direct threat to our proposal.

A second competitor is multiple imputation of the missing mediators from in-network history, followed by the same doubly robust estimator. It represents the practical default in applied EHR work.

The key ablation is our estimator with the proxy bridges removed, which collapses it to the missing-at-random competitor. Any gain can then be attributed to the proxy step and not to other design choices.

All methods share the same cohort, time windows, covariates, learner library, cross-fitting folds, and tuning budget. They are compared on identical bootstrap resamples.

There is no reported result found on Lacuna for any mediation estimator on a serial chain under fragmentation, so no published number exists to beat. The closest reported figures are these. Naive least-squares path models showed bias of 0.5 and 29% confidence-interval coverage under confounding, against near-nominal coverage for the proximal estimator, in the simulations of Proximal mediation analysis. The proximal implicit-bias estimator recovered a planted effect of 0.5 in semi-synthetic UK Biobank data (implicit bias paper).

Beating the strongest competitor means two things. In semi-synthetic data where leaving the network depends on the mediator's value, our estimator must have lower absolute bias and near-95% coverage while the missing-at-random estimator does not. In the real truncation experiment, it must close a materially larger share of the gap between single-system and full-exchange estimates.

Why not just…?

Why not just weight for missingness and assume it is random given history? This is a genuine threat. If the reason a lab is missing is fully explained by observed prior labs and visits, the missing-at-random competitor is consistent and simpler than our method. The file offers indirect evidence against this. The lab-sampling study found undersampling an order of magnitude more common than oversampling and traced much of it to outside care (nonstationary GP), and referral is clinically driven by the very values being measured. That evidence does not settle the question. The truncation experiment does: if the missing-at-random estimator already closes the single-system gap in INPC, we will report that our extra machinery is unnecessary.

Why not just impute the missing labs and run a standard mediation estimator? Imputation from in-network history rests on the same missing-at-random assumption, so it inherits the same bias. It also understates uncertainty when the imputation model is misspecified. We include it as a baseline, and the semi-synthetic regime with value-dependent departure is designed to show whether it fails in the same way.

Why not just restrict to patients who stayed in-network? Continuous in-network patients are selected on the chain itself, for example people whose kidneys did not worsen enough to need referral. Conditioning on staying therefore conditions on a descendant of the mediators. The naive complete-case baseline measures exactly this.

Why not just treat both mediators as one joint mediator, as med_bench does? That gives the total indirect effect through the pair but cannot say whether glycemic control acts through kidney trajectory. That is the scientific question, and it matters for choosing what to monitor. The joint estimate is still reported as a consistency check, since it should bound the sum of the path-specific pieces.

Why not just use the full exchange data and skip the method? Most institutions have no exchange, and the exchange itself is incomplete. The exchange serves here as a measuring instrument for fragmentation bias, not as a deployable fix.

Proposed Experiments

The first experiment is semi-synthetic. We keep real INPC covariates, visit timing, and treatment histories and simulate the mediators and outcome with a planted interventional serial effect. We then impose network departure under three regimes: completely random, dependent on observed history, and dependent on the mediator's own value. The departure strength rises until effective sample size collapses. Metrics are bias, root mean squared error, confidence-interval coverage and width, and effective sample size. The decisive pattern is that all robust methods agree in the first two regimes, while only the proxy estimator stays near nominal coverage in the third.

The second experiment is the real truncation test. We estimate the serial effect on the full linked exchange view and then on each patient's home-system view, and we report the fraction of the gap each method closes. This comparison attributes the gap to fragmentation alone, because the analysis method is held fixed across the two views. It does not claim the full-view number is the causal truth.

Two falsification checks go alongside. The first is a placebo chain whose "mediator" is a pre-treatment HbA1c; its serial effect must be zero under every method. The second is a sensitivity analysis that replaces raw window summaries with the nonstationary Gaussian-process estimates of the lab-sampling paper. It checks that the estimated chain is not an artifact of sparse sampling making trajectories look smoother than they are.

If proxy-validity tests fail for the diabetes chain, or if the missing-at-random baseline closes the real-data gap, the proposal still delivers a result: a measured map of how much single-institution chain-mediation estimates can and cannot be trusted.