11  Transportability: Generalising Structural Claims

Status: Draft

v0.5

11.1 Introduction

Scientific claims often need to move across domains: cohorts, sites, years, or protocols (Bareinboim and Pearl 2013; Pearl and Bareinboim 2014). Transportability treats that move as a causal question: which mechanisms and edges are invariant, and which depend on domain?

In the organism–environment language of Chapter 9, transport is chiefly a change of environment (policies, measurement, cohort mix): does the same structural society (invariant \(G\) and mechanism class) still hold?

11.2 The transportability problem

Can a causal claim established in domain \(\mathcal{D}_1\) be used in \(\mathcal{D}_2\)? Typical domain axes include age, site, calendar time, and experimental protocol.

Some mechanisms are plausibly invariant (shared biology or physics); others vary (treatment assignment, measurement, population composition). The modelling task is to mark that difference explicitly rather than hoping invariance holds by default.

11.3 Encoding domain shift

Introduce context variables \(\mathbf{C}\) for domain characteristics. Mechanisms may depend on \(\mathbf{C}\),

\[ X_i \coloneqq f_i(\mathrm{Pa}(X_i), \mathbf{C}, U_i), \]

or omit \(\mathbf{C}\) when the assignment is claimed invariant. Edges from \(\mathbf{C}\) into \(A\) or \(Y\) in a selection / context diagram encode which parts of the data-generating process shift (Pearl and Bareinboim 2014).

project_root = let
    current = pwd()
    while !isfile(joinpath(current, "Project.toml")) && !isfile(joinpath(current, "_quarto.yml"))
        parent = dirname(current)
        parent == current && break
        current = parent
    end
    current
end
include(joinpath(project_root, "scripts", "ensure_packages.jl"))
@auto_using DAGMakie CairoMakie Graphs CausalDynamics StableRNGs

# Context C confounds treatment A and outcome Y across domains
g_ctx, ctx_labels = confounding_graph(["C", "A", "Y"])
println("Context diagram edges (C → A, A → Y, C → Y):")
for e in edges(g_ctx)
    println("  ", ctx_labels[src(e)], " → ", ctx_labels[dst(e)])
end
id = identify(g_ctx, TotalEffectQuery(2, 3); node_names = [:C, :A, :Y])
println("identify A→Y with C present: strategy=$(id.strategy), adjustment=$(id.adjustment)")
Context diagram edges (C → A, A → Y, C → Y):
  C → A
  C → Y
  A → Y
identify A→Y with C present: strategy=backdoor, adjustment=[:C]
(Scene(1 children, 0 plots), Makie.Axis (1 plots), Plot{GraphMakie.graphplot, Tuple{SimpleDiGraph{Int64}}})

Context \(C\) as a common cause of treatment \(A\) and outcome \(Y\): a minimal domain-shift diagram.

11.4 Criteria and practice

Given a graph with context / selection nodes:

  1. Put \(\mathbf{C}\) (or selection indicators) in the diagram explicitly.
  2. Ask which edges out of \(\mathbf{C}\) are present (assignment shift, effect modification, both).
  3. Apply transportability theorems when the diagram matches a known pattern (Bareinboim and Pearl 2013), or adjust / reweight when \(\mathbf{C}\) is observed.
  4. Check sensitivity: how wrong is the claim if an assumed invariant edge is not?
  5. Prefer external validation in the target domain when feasible.

11.5 Testing effect modification across domains

A minimal statistical check for mechanism shift is an interaction of treatment with domain. Synthetic data with different treatment effects by cohort:

@auto_using Random Distributions GLM DataFrames StableRNGs

rng = StableRNG(42)
n_per = 200

A_d1 = rand(rng, Distributions.Bernoulli(0.3), n_per)
Y_d1 = 0.5 .* A_d1 .+ rand(rng, Distributions.Normal(0, 0.2), n_per)

A_d2 = rand(rng, Distributions.Bernoulli(0.7), n_per)
Y_d2 = 0.3 .* A_d2 .+ rand(rng, Distributions.Normal(0, 0.2), n_per)

df = DataFrame(
    C = [zeros(n_per); ones(n_per)],
    A = Float64[A_d1; A_d2],
    Y = [Y_d1; Y_d2],
)

model = lm(@formula(Y ~ A + C + A * C), df)
β = coef(model)
δ = length(β) >= 4 ? β[4] : 0.0
println("Estimated A effect at C=0: ", round(β[2]; digits = 3))
println("Estimated A effect at C=1: ", round(β[2] + δ; digits = 3))
println("Interaction A×C: ", round(δ; digits = 3))
println(abs(δ) > 0.1 ?
    "Mechanisms differ by domain → transport needs C (or domain-specific effects)." :
    "No large interaction in this draw → invariance more plausible (still not proof).")
Estimated A effect at C=0: 0.523
Estimated A effect at C=1: 0.319
Interaction A×C: -0.203
Mechanisms differ by domain → transport needs C (or domain-specific effects).
NoteAge-dependent mechanisms

If \(Y \coloneqq f(A, C, U)\) with \(C\) = age band, transporting an effect estimated in one band to another requires either invariance (no \(C\) in \(f\)) or an explicit adjustment / stratified effect. Assuming invariance without a diagram or check is the usual failure mode.

11.6 Dataset shift as a causal problem

Standard ML “dataset shift” labels map onto causal distinctions:

  • Covariate shift: \(P(X)\) changes, \(P(Y \mid X)\) invariant
  • Label shift: \(P(Y)\) changes, \(P(X \mid Y)\) invariant
  • Mechanism shift: structural assignments change

Framing the shift with \(\mathbf{C}\) and edges clarifies what reweighting or retraining can achieve.

11.7 Worked example: AgeSCM country hold-out

The AgeSCM application (Case Study 3, Chapter 28b) treats generalisation of MIRS mosquito-age models as transport of predictive performance across context C (country). The primary metric is leave-one-country-out (LOSO) MAE.

Weight scheme Model Pooled MAE (days) Interpretation
T0 Mean spectrum OLS 23.73 Unweighted transport baseline
T0 Stage 1 + encoder 24.17 Best unweighted deep+SCM pipeline
T2 Mean spectrum OLS 22.87 IPTW using \(P(C \mid\) nuisances\()\)
T2 Stage 1 + encoder 23.81 Weighted SCM; small gain over T0 encoder
T1 Mean spectrum OLS 29.57 Marginal IPTW harmful (poor overlap)

Reweighting toward the test-domain mix helps the simplest spectral baseline when propensity is modelled on measured nuisances; it does not uniformly rescue CNN pipelines. Structural invariance of the age→spectrum mechanism remains an open audit alongside predictive transport.

11.8 Stratum context

Transportability sits on a Structural → Observable bridge: invariant mechanisms are structural claims; whether they hold in new data is an observable question. It prepares the move from Part I toward time and measurement in later parts without assuming every cohort shares the same generating process.

11.9 Summary

Cross-domain claims need diagrams that mark what \(\mathbf{C}\) changes. Invariant mechanisms travel; domain-dependent assignment or effect edges need adjustment, stratification, or honest restriction of the target population. Statistical interactions and hold-out metrics (as in AgeSCM) are checks, not substitutes for the causal diagram.

11.10 Further Reading