Tutorials › Marginal Structural Models › Multiple Treatment Components in Weighted Cox Models

Fitting MSMs for Survival Outcomes · Tutorial 177 of 501

Multiple Treatment Components in Weighted Cox Models

Specify and interpret weighted Cox models with multiple treatment components, and calculate joint hazard contrasts and treatment interactions from their fitted coefficients.

Advanced 12 min read

What You'll Learn

  • Represent multiple treatment components and their histories with a Cox model design vector.
  • Specify a weighted marginal structural Cox model with component main effects and an interaction.
  • Calculate hazard ratios for joint treatment contrasts from coefficient differences.
  • Interpret a product-term coefficient through component-specific hazard ratios.
  • Diagnose inadequate treatment-combination support and misspecified interaction structure.
  • Compare product-term models with additive and joint-category encodings.

Why Model Treatment Components Jointly?

A treatment strategy may have several components: for example, a medication and a behavioral intervention, or two medications that can be used separately or together. Modeling each component does not require assuming that their effects combine in a particular way. The design of the weighted Cox model makes that assumption explicit: main effects alone impose a multiplicative hazard structure, while an interaction term allows the association of one component to depend on the level of another.

The earlier material on encoding treatment histories and flexible functional forms applies to each component separately. Here, write \(X_{1i}(t)\) and \(X_{2i}(t)\) for the treatment features of interest for individual \(i\) at time \(t\). Each feature may be a current treatment indicator, a function of treatment history, or another prespecified summary. The essential requirement is that each is defined consistently with the intervention contrasts being studied and is measured at the appropriate time for the risk interval.

Definition: A multiple-component treatment design is a vector of treatment features, such as \(X_i(t)=(X_{1i}(t),X_{2i}(t))\), used to represent the treatment strategies in a marginal structural model. A product term \(X_{1i}(t)X_{2i}(t)\) allows the model’s hazard ratio for one component to vary with the other component. The fitted model describes the specified component contrasts; it does not automatically describe every possible treatment strategy.

Model Specification and Assumptions

For two binary components, a common model for the counterfactual hazard under a treatment strategy \(g\) is

$$ \lambda^g(t)=\lambda_0(t)\exp\{\beta_1 X_1^g(t)+\beta_2 X_2^g(t)+\beta_{12}X_1^g(t)X_2^g(t)\}. $$

Here \(\lambda_0(t)\) is the baseline hazard, and \(X_q^g(t)\) is the value of component feature \(q\) under strategy \(g\). In the observed, weighted Cox fit, the same linear predictor is evaluated using the observed features \(X_{qi}(t)\). If both components are time-varying, their values must be aligned to the same risk interval; if a component represents cumulative exposure, it is that prespecified summary—not an interchangeable current-use indicator—that enters the model.

The model has a causal interpretation only under the assumptions needed for the weighted marginal structural analysis: consistency of observed outcomes with the corresponding treatment strategies; sequential exchangeability given the measured treatment and censoring history used to construct the weights; positivity for the treatment decisions represented by the contrasts; and correct construction of those weights. In addition, the specified marginal structural hazard model must adequately represent the causal hazards over the target time range. The treatment design must also distinguish the strategies whose contrasts are requested. A well-fitting Cox regression cannot compensate for violations of these identification assumptions.

With estimated weights \(W_i(t)\), a weighted Cox fit uses the treatment design vector \(Z_i(t)\), for example \((X_{1i}(t),X_{2i}(t),X_{1i}(t)X_{2i}(t))^\mathsf{T}\). In the no-ties expression, its weighted partial log-likelihood has contributions

$$ \ell_w(\beta)=\sum_i\int W_i(t)\left[ \beta^\mathsf{T}Z_i(t)- \log\left\{\sum_jY_j(t)W_j(t)\exp\big(\beta^\mathsf{T}Z_j(t)\big)\right\} \right]dN_i(t), $$

where \(Y_i(t)\) indicates membership in the risk set and \(N_i(t)\) is the event-counting process. This expression shows where the multiple-component design enters: every event contribution and risk-set comparison uses the same chosen vector of treatment features. Details of risk sets, weight timing, and weighted Cox score estimation belong to the earlier material on those topics.

Contrasts From the Fitted Model

For two strategies \(g_a\) and \(g_b\) at time \(t\), define their design vectors \(Z^{g_a}(t)\) and \(Z^{g_b}(t)\). Under the stated model, the hazard ratio is determined by the difference in their linear predictors.

Result: If the model is \(\lambda^g(t)=\lambda_0(t)\exp\{\beta^\mathsf{T}Z^g(t)\}\), then \(\lambda^{g_a}(t)/\lambda^{g_b}(t)=\exp\{\beta^\mathsf{T}[Z^{g_a}(t)-Z^{g_b}(t)]\}\), whenever both hazards are defined and the same baseline hazard applies.

To verify this, substitute each design vector into the model and divide:

$$ \frac{\lambda^{g_a}(t)}{\lambda^{g_b}(t)} = \frac{\lambda_0(t)\exp\{\beta^\mathsf{T}Z^{g_a}(t)\}} {\lambda_0(t)\exp\{\beta^\mathsf{T}Z^{g_b}(t)\}} = \exp\{\beta^\mathsf{T}[Z^{g_a}(t)-Z^{g_b}(t)]\}. $$

The baseline hazard cancels, but the treatment contrast must still be computed from all design terms, including any interactions. When treatment features vary with time, the contrast can also vary with time even if the coefficients are constant.

Worked Example: Both Components Versus Neither

Suppose \(X_1\) and \(X_2\) are binary, with reference strategy \((0,0)\), and the fitted coefficients are \(\hat\beta_1=\log(2)\), \(\hat\beta_2=\log(1.5)\), and \(\hat\beta_{12}=\log(2)\). The design vector is \((X_1,X_2,X_1X_2)\). Calculate the hazard ratio for \((1,1)\) versus \((0,0)\).

The design vectors are \(Z(1,1)=(1,1,1)\) and \(Z(0,0)=(0,0,0)\). Their linear-predictor difference is \[ \hat\beta_1+\hat\beta_2+\hat\beta_{12} =\log(2)+\log(1.5)+\log(2)=\log(6). \] Therefore the estimated hazard ratio is \(\exp\{\log(6)\}=6\). The interaction contributes a factor of 2; omitting it would give \(2\times1.5=3\), which is a different model’s contrast.

What the Interaction Coefficient Means

For binary components, the model’s log hazard at each treatment combination, relative to \((0,0)\), is particularly transparent:

$$ \begin{aligned} \log\{\lambda^{(0,0)}(t)/\lambda_0(t)\}&=0,\\ \log\{\lambda^{(1,0)}(t)/\lambda_0(t)\}&=\beta_1,\\ \log\{\lambda^{(0,1)}(t)/\lambda_0(t)\}&=\beta_2,\\ \log\{\lambda^{(1,1)}(t)/\lambda_0(t)\}&=\beta_1+\beta_2+\beta_{12}. \end{aligned} $$

Thus \(\exp(\beta_{12})\) is not, by itself, the hazard ratio for receiving both components rather than neither. It is a ratio of hazard ratios: the component-1 hazard ratio when component 2 is present, divided by the component-1 hazard ratio when component 2 is absent.

Result: For the binary two-component model, the ratio of the component-1 hazard ratio at \(X_2=1\) to that at \(X_2=0\) equals \(\exp(\beta_{12})\). Indeed, the two hazard ratios are \(\exp(\beta_1+\beta_{12})\) and \(\exp(\beta_1)\); dividing gives \(\exp(\beta_{12})\). The same calculation with the component roles exchanged gives the same ratio. \(\square\)

This is a multiplicative interaction on the hazard scale. It does not assert interaction on the risk-difference or survival-probability scale, and it does not imply a biological mechanism. Those interpretations require different estimands and assumptions.

Worked Example: Component-Specific Hazard Ratios

Use the coefficients from the previous example. Find the component-1 hazard ratio when \(X_2=0\), when \(X_2=1\), and the ratio between those hazard ratios.

At \(X_2=0\), changing \(X_1\) from 0 to 1 changes the linear predictor by \(\hat\beta_1=\log(2)\), so the hazard ratio is 2. At \(X_2=1\), the change is \(\hat\beta_1+\hat\beta_{12}=\log(2)+\log(2)=\log(4)\), so the hazard ratio is 4. Their ratio is \(4/2=2=\exp(\hat\beta_{12})\). In contrast, the component-2 hazard ratio is 1.5 when \(X_1=0\), and \(1.5\times2=3\) when \(X_1=1\).

More Than Two Levels and Time-Varying Components

A treatment component with more than two levels should generally be represented by indicator variables relative to a stated reference level. Interactions then involve the relevant indicator products, not an arbitrary numeric label for the treatment category. For example, a three-level component \(A\in\{0,1,2\}\) can be coded with indicators \(I(A=1)\) and \(I(A=2)\), taking \(A=0\) as reference. If a binary component \(B\) may modify its effects, include both products with \(B\).

Worked Example: A Three-Level Component With a Modifier

Let \(A=0\) be the reference, let \(A=1,2\) be represented by indicators \(D_1,D_2\), and let \(B\) be binary. Suppose \[ \eta=0.4D_1+0.7D_2+0.2B+0.3D_1B-0.1D_2B. \] Calculate the hazard ratio for \((A=2,B=1)\) versus \((A=0,B=0)\).

At \((A=2,B=1)\), \(D_1=0,D_2=1,B=1\), so \(\eta=0+0.7+0.2+0-0.1=0.8\). At the reference, all design terms equal zero. The contrast is therefore \(\exp(0.8)\), approximately \(2.23\). For comparison, \(A=2\) versus \(A=0\) when \(B=0\) has log hazard ratio \(0.7\), whereas the same contrast when \(B=1\) has log hazard ratio \(0.7-0.1=0.6\).

For two time-varying components, the same calculation applies at each time using their values under each strategy. Suppose the model uses current indicators \(X_1(t),X_2(t)\) and the coefficients are \(\beta_1=\log(1.4)\), \(\beta_2=\log(1.2)\), and \(\beta_{12}=\log(1.5)\). At a time when a strategy assigns both components and the comparator assigns neither, the hazard ratio is \(1.4\times1.2\times1.5=2.52\). If instead the strategy assigns only component 1, its hazard ratio versus neither is 1.4. These are pointwise hazard contrasts under the model, not contrasts of cumulative survival probabilities.

Choosing and Checking the Treatment Design

The model should reflect the scientific contrasts, not simply include every possible product. With two binary components, main effects only impose no interaction on the log-hazard scale: the joint hazard ratio versus neither is the product of the two separate hazard ratios. Adding a product term relaxes that restriction. A four-level joint-category factor is an alternative for two binary components: it estimates each of the four combinations relative to a reference without imposing the product-term parameterization. With all four combinations represented, the two parameterizations span the same four cell-specific log hazards, but they organize and interpret those hazards differently. A product-term model makes the interaction contrast explicit; a joint-category model makes each cell contrast direct. Neither creates support for treatment combinations absent from the data.

Useful diagnostics are tied to the treatment design. Tabulate observed treatment combinations and inspect how many weighted risk-set observations support each combination over time. Check whether extreme weights or very small effective weighted risk sets are concentrated in a particular combination. Compare fitted and observed weighted event patterns across component combinations, and assess whether adding a scientifically plausible interaction materially changes the contrasts of interest. If the model uses time-varying or cumulative component features, verify that their coding matches the intended strategies and that no future treatment information enters an earlier risk interval.

  • Positivity failure: if a joint treatment combination is never or rarely observed for histories represented in the target population, its weighted contrast may be unidentified or unstable. A finite fitted coefficient does not resolve the lack of support.
  • Overly restrictive main effects: omitting an interaction asserts a constant component hazard ratio across levels of the other component. This can misrepresent the specified marginal hazards.
  • Uninterpretable coding: multiplying category labels such as 1 and 2 treats the labels as quantitative scores. Use indicators and define the reference contrasts.
  • Scale confusion: a Cox interaction concerns multiplicative hazards. It is not automatically an interaction in survival probability or absolute risk.

A practical limitation is that a richly interacted design can require substantial support across treatment combinations and can yield imprecise estimates. Conversely, a simpler model may be more stable but impose stronger assumptions. The choice should be guided by the target contrasts, scientific knowledge, support in the weighted risk sets, and the adequacy of the resulting model—not by the mere availability of a product-term option in software.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. In a binary two-component model, what is the hazard ratio for \((1,1)\) versus \((0,0)\) in terms of the coefficients?
  2. If \(\beta_{12}=0\), what restriction does the model impose on the component-1 hazard ratio across the two levels of component 2?
  3. With a three-level component coded by two indicators, why should an interaction with a binary component use indicator products rather than the raw category label?
  4. Name one diagnostic warning that a joint treatment contrast may be poorly supported, even if the fitted model returns a coefficient.

Solutions. (1) The contrast is \(\exp(\beta_1+\beta_2+\beta_{12})\), because the joint design vector is \((1,1,1)\) and the reference vector is \((0,0,0)\). (2) The component-1 hazard ratio is \(\exp(\beta_1)\) at either level of component 2, since \(\exp(\beta_1+\beta_{12})=\exp(\beta_1)\) when \(\beta_{12}=0\). (3) Category labels are not generally quantitative distances; indicator products represent separate, interpretable contrasts against the chosen reference. (4) Examples include an absent or very small treatment-combination group in weighted risk sets, extreme weights concentrated in that group, or a very small effective weighted risk set.

Clinical Biostats