Tutorials › Marginal Structural Models › Nonlinear Link Functions in Structural Nested Mean Models

Structural Nested Models and g-Estimation · Tutorial 334 of 501

Nonlinear Link Functions in Structural Nested Mean Models

Learn to define nonlinear treatment blips precisely and translate their parameters into interpretable contrasts on the outcome scale.

Advanced 11 min read

What You'll Learn

  • Define a structural nested mean blip through a link-scale contrast of counterfactual conditional means.
  • Interpret log-link blips as ratios of conditional means and calculate their response-scale implications.
  • Distinguish identity-, log-, and logit-link treatment effects using explicit numerical examples.
  • Formulate nested contrasts at successive treatment decisions without assuming their parameters add on the outcome scale.
  • Check link-domain conditions and recognize when a chosen effect scale is scientifically unsuitable.

Why the Link Function Changes the Meaning of a Blip

A treatment blip describes how a conditional mean changes when treatment is switched from a reference value to another value. With an identity link, the blip is a difference in means. With a log link, it is a difference in log means, and therefore a ratio of means. These are different causal questions, not merely different ways of fitting the same parameterization.

The choice of link is especially consequential when outcomes are positive, when relative effects are scientifically important, or when the size of a mean difference naturally depends on the untreated mean. This tutorial defines the contrast precisely, derives its interpretation, and shows how the same numerical link-scale parameter can imply different changes in the outcome mean for different links.

Definition: A Link-Scale Treatment Blip

First consider one treatment decision. Let \(L\) be measured pre-treatment covariates, let \(A\) be treatment with reference value \(0\), and let \(Y(a)\) be the potential outcome under treatment value \(a\). Define the conditional counterfactual mean \(\mu(a,l)=E[Y(a)\mid L=l]\). Suppose this mean is finite for the treatment values under consideration. A link function \(g\) maps the allowable means to a real-valued scale.

Definition: A link-scale structural nested mean model (SNMM) specifies the treatment blip \(\Gamma(a,l)=g\{\mu(a,l)\}-g\{\mu(0,l)\}\) through a model \(\Gamma(a,l)=\gamma(a,l;\psi)\), where \(\gamma(0,l;\psi)=0\). The blip is the contrast between the mean under \(a\) and the mean under the reference treatment, conditional on the same pre-treatment covariates. The link \(g\) determines the scale on which this contrast is defined.

The model concerns conditional means of potential outcomes. A log-link SNMM does not assert that the observed outcome itself has a log-linear distribution, and it is not a model for \(E[\log Y(a)\mid L]\). It asserts a model for the difference between the logarithms of two conditional means. The link must be defined at the means being modeled: for example, the log link requires strictly positive means, while the logit link requires means strictly between zero and one.

For a longitudinal treatment history, the corresponding blips are nested contrasts. At decision time \(t\), one can define a conditional mean under a treatment history through time \(t\), with later treatments fixed to a specified reference regime, and contrast it with the mean when treatment at \(t\) is set to its reference value, holding the pre-decision history fixed. The link-scale contrast at that decision is the time-\(t\) blip. The history and future-treatment convention must be stated because they determine which nested means are being compared. In general, one must not assume that link-scale blips from different times can simply be added to obtain a full-regime mean; the relevant nested means and conditional histories must be handled recursively.

Log-Link Blips: From Ratios to Mean Differences

For a positive conditional mean, take \(g(\mu)=\log(\mu)\). If the blip is \(\gamma(a,l;\psi)\), its defining equation is \(\log\{\mu(a,l)\}-\log\{\mu(0,l)\}=\gamma(a,l;\psi)\). Exponentiating gives the response-scale interpretation directly.

Result: Under a log-link SNMM, \(\mu(a,l)=\mu(0,l)\exp\{\gamma(a,l;\psi)\}\). Thus \(\exp\{\gamma(a,l;\psi)\}\) is the ratio of the conditional mean under treatment \(a\) to the conditional mean under reference treatment, at covariate value \(l\). The corresponding mean difference is \(\mu(0,l)[\exp\{\gamma(a,l;\psi)\}-1]\).

Derivation. Start from the blip definition and use the log difference identity: \(\log\{\mu(a,l)/\mu(0,l)\}=\gamma(a,l;\psi)\). Applying the exponential to both sides yields \(\mu(a,l)/\mu(0,l)=\exp\{\gamma(a,l;\psi)\}\), which gives both the ratio and the displayed mean difference. This argument requires \(\mu(a,l)>0\) and \(\mu(0,l)>0\), so both logarithms exist. \(\square\)

A common simple model is \(\gamma(a,l;\psi)=\psi a\). For a one-unit increase in treatment, the conditional mean is multiplied by \(\exp(\psi)\), provided the model has no treatment-by-covariate interaction and the treatment scale makes a one-unit contrast meaningful. For a change from \(a\) to \(a+\delta\), the ratio is \(\exp\{\psi\delta\}\). If the blip is nonlinear in treatment, such as \(\psi_1a+\psi_2a^2\), the ratio for that change is instead \(\exp\{\gamma(a+\delta,l;\psi)-\gamma(a,l;\psi)\}\).

Worked Example: A Continuous-Treatment Log Blip

Suppose the reference conditional mean is \(\mu(0,l)=10\), and the model is \(\gamma(a,l;\psi)=0.2a\). Compare treatment \(a=2\) with the reference.

The blip is \(0.2(2)=0.4\). The mean ratio is \(\exp(0.4)\approx1.4918\), so the treated conditional mean is \(10(1.4918)\approx14.918\). The mean difference is \(14.918-10=4.918\).

For a one-unit treatment increase, the ratio is \(\exp(0.2)\approx1.2214\), or about a 22.1% increase in the conditional mean. This is not a fixed increase of 2.21 outcome units: at a reference mean of 20, the same one-unit treatment contrast gives a mean of \(20(1.2214)\approx24.428\), a difference of about 4.428 units.

How Different Links Translate the Same Blip

The inverse link converts a blip back to the outcome-mean scale. More generally, if the reference mean is \(\mu_0=\mu(0,l)\), then \(\mu(a,l)=g^{-1}[g(\mu_0)+\gamma(a,l;\psi)]\), wherever the expression is defined. This equation shows why the link determines the parameter’s interpretation.

Result: For a differentiable inverse link and differentiable blip as a function of treatment \(a\), \(\frac{\partial\mu(a,l)}{\partial a}=(g^{-1})'[g(\mu_0)+\gamma(a,l;\psi)]\frac{\partial\gamma(a,l;\psi)}{\partial a}\). For the identity link this becomes \(\partial\gamma/\partial a\). For the log link it becomes \(\mu(a,l)\partial\gamma/\partial a\). For the logit link it becomes \(\mu(a,l)\{1-\mu(a,l)\}\partial\gamma/\partial a\).

Derivation. Hold \(l\) fixed, so \(\mu_0\) is constant in \(a\), and differentiate the inverse-link expression by the chain rule. The derivative of the inner term \(g(\mu_0)+\gamma(a,l;\psi)\) is \(\partial\gamma/\partial a\). For the identity link, \(g^{-1}(x)=x\), whose derivative is 1. For the log link, \(g^{-1}(x)=\exp(x)\), whose derivative is \(\exp(x)=\mu(a,l)\). For the logit link, \(g^{-1}(x)=\exp(x)/\{1+\exp(x)\}\); differentiating gives \(g^{-1}(x)\{1-g^{-1}(x)\}=\mu(a,l)\{1-\mu(a,l)\}\). Substitution yields the three expressions. The calculation assumes the link and inverse link are differentiable at the relevant values. \(\square\)

The identity-link result gives a constant mean difference when the blip is linear in treatment. Under a log link, a constant derivative of the blip gives a proportional change in the mean, so the absolute change depends on the current mean. Under a logit link, the blip is a log-odds contrast for a binary outcome; the response-scale change in probability depends on the current probability.

Worked Example: Additive and Multiplicative Blips at Two Baseline Means

Consider two covariate groups with reference means 10 and 30. Compare an identity-link blip of 2 with a log-link blip of 0.2.

Identity link. The treated mean is the reference mean plus 2. The two means become \(10+2=12\) and \(30+2=32\). The effect is a difference of 2 in both groups, while the ratios are \(12/10=1.2\) and \(32/30\approx1.0667\).

Log link. The ratio in each group is \(\exp(0.2)\approx1.2214\). The treated means become \(10(1.2214)\approx12.214\) and \(30(1.2214)\approx36.642\). The differences are approximately 2.214 and 6.642.

Thus the identity model holds the absolute difference fixed, whereas the log model holds the ratio fixed. Neither parameterization says that both the difference and ratio are constant across these groups.

Worked Example: A Logit Blip Is Not a Risk Ratio

Suppose a binary outcome has reference risks \(0.2\) and \(0.6\) in two covariate groups. Let the treatment blip on the logit scale be \(\log(2)\) in each group. The odds ratio is \(\exp\{\log(2)\}=2\), but the risks must be calculated by adding \(\log(2)\) to each reference log-odds and applying the inverse logit.

For the first group, the reference odds are \(0.2/0.8=0.25\). Doubling gives treated odds \(0.5\), corresponding to risk \(0.5/(1+0.5)=1/3\). The risk ratio is \((1/3)/0.2=5/3\approx1.667\), and the risk difference is \(1/3-0.2\approx0.133\).

For the second group, the reference odds are \(0.6/0.4=1.5\). Doubling gives treated odds \(3\), corresponding to risk \(3/(1+3)=0.75\). The risk ratio is \(0.75/0.6=1.25\), and the risk difference is \(0.75-0.6=0.15\). The odds ratio is 2 in both groups, but neither the risk ratio nor the risk difference is the same in both.

Assumptions, Scale Choice, and Diagnostics

A link-scale SNMM is a structural model for causal conditional means, but writing one down does not by itself identify its parameters from observed data. A causal interpretation also needs appropriate conditions connecting observed and counterfactual outcomes, including consistency and sequential exchangeability given the measured history at each decision. There must be treatment support for the contrasts being considered; for example, a treatment value cannot be compared with the reference within a history stratum where it is impossible. These conditions do not make an incorrect blip functional form correct.

Choose a link based on the scientific contrast and the outcome domain. A log link is natural when a multiplicative mean contrast is meaningful, but it requires positive means and a valid model over the treatment and covariate range. A logit link is available for probabilities strictly between zero and one and expresses odds ratios, not risk ratios. An identity link targets differences but can imply impossible means for outcomes constrained to be nonnegative or probabilities constrained to the unit interval.

Several practical checks follow directly from these definitions:

  • Verify that the reference treatment gives a zero blip: \(\gamma(0,l;\psi)=0\). A nonzero reference blip contradicts the stated contrast.
  • Check that every modeled mean falls in the domain required by the link. A log-link mean cannot be zero or negative; a logit-link mean cannot be outside \((0,1)\).
  • Translate estimates back to the mean or probability scale at several relevant reference values. A coefficient alone can obscure how much absolute impact the model implies.
  • Check whether the treatment shape and effect modification match the scientific question. A constant log-link slope implies a common proportional effect only where the model actually imposes that restriction.
  • Examine whether conclusions change materially under scientifically plausible alternative scales. A scale choice is part of the estimand, not just a computational convenience.

A frequent mistake is to interpret \(\psi\) identically across links. For example, saying “\(\psi=0.2\) means an increase of 0.2 in the outcome” is wrong if the model is \(\log\{\mu(a,l)\}-\log\{\mu(0,l)\}=0.2a\). The correction is to identify the modeled scale first: at a one-unit increase, this model implies a mean ratio of \(\exp(0.2)\), and the mean difference depends on the reference mean.

Another mistake is to treat a logit blip as a risk ratio because both can describe relative effects. The logit blip exponentiates to an odds ratio; the worked example shows that corresponding risk ratios vary with the reference risk. Likewise, nonlinear link-scale increments at multiple treatment times do not automatically sum to a single overall contrast. Each increment refers to its defined nested means, and translating a longitudinal regime effect requires respecting the model’s recursive structure.

Compared with an identity-link SNMM, a log-link SNMM directly parameterizes relative mean effects and can avoid a constant absolute effect across populations with different reference means. Compared with a logit-link SNMM for a binary outcome, it targets a mean or risk ratio rather than an odds ratio, when the log-link model is valid. None is universally preferable: the outcome type, causal question, range of plausible means, and interpretability of the effect scale all matter.

Check Your Understanding

Answer each question, then compare with the worked solutions below.

  1. Under a log-link SNMM, the blip for a treatment contrast is \(-0.3\). What is the mean ratio for that contrast, and is it a decrease or an increase?
  2. A log-link model has reference mean 8 and a blip of \(\log(1.5)\). Calculate the treated mean and the mean difference.
  3. Why does a constant logit blip not generally imply a constant risk difference across covariate groups?
  4. State one domain condition required for each of the log and logit links in a conditional-mean SNMM.

Solutions. 1. The ratio is \(\exp(-0.3)\approx0.7408\), so the mean is about 25.9% lower than the reference mean. 2. The ratio is \(\exp\{\log(1.5)\}=1.5\); the treated mean is \(8(1.5)=12\), and the difference is \(12-8=4\). 3. The inverse-logit transformation depends on the reference risk: the same log-odds increment changes probabilities by different amounts at different starting probabilities. 4. The log link requires strictly positive conditional means; the logit link requires conditional means strictly between zero and one.

Clinical Biostats