Tutorials › Causal Inference › Pooled Logistic Marginal Structural Models for Discrete-Time Outcomes

Marginal Structural Models · Tutorial 738 of 972

Pooled Logistic Marginal Structural Models for Discrete-Time Outcomes

Build and interpret a weighted pooled logistic model for discrete-time causal hazards, then translate its hazards into cumulative risks under treatment regimes.

Advanced 10 min read

What You'll Learn

  • Define a discrete-time counterfactual hazard among individuals event-free at the start of an interval.
  • Arrange longitudinal follow-up in person-period rows and identify which rows contribute to the outcome model.
  • Describe how cumulative treatment and censoring weights are attached to person-period observations.
  • Specify and interpret a pooled logistic marginal structural model for treatment-regime hazards.
  • Convert regime-specific hazards into cumulative risks and distinguish those contrasts from hazard contrasts.
  • Recognize the identification and model conditions needed for causal interpretation.

Why Model Discrete-Time Hazards?

When an outcome is recorded at scheduled visits, its event time is often known only to lie within an interval. Examples include the first visit at which a diagnosis is detected or the interval in which a participant first experiences an event. A discrete-time hazard model describes the chance of an event in each interval among those who have not yet experienced it. In longitudinal causal studies, treatment and confounders may change over time, so ordinary outcome regression can condition on variables affected by earlier treatment. A weighted marginal structural model (MSM) offers a way to estimate regime-specific hazards while addressing this treatment-confounder feedback.

The data are arranged as person-period records: a person contributes one record for each interval in which they remain under observation and event-free at its start. A pooled logistic model treats those records as a single data set, with time and treatment history as predictors. “Pooled” refers to fitting across intervals; it does not mean that the event status or risk set is ignored.

Definition: Let \(Y_t\) indicate whether the event has occurred by the end of interval \(t\), with \(Y_0=0\). For treatment history \(\bar a_t=(a_1,\ldots,a_t)\), the discrete-time counterfactual hazard in interval \(t\) is $$ h_t^{\bar a_t}=P(Y_t^{\bar a_t}=1\mid Y_{t-1}^{\bar a_{t-1}}=0). $$ It is the probability of the event during interval \(t\), conditional on remaining event-free through interval \(t-1\), under the specified treatment history. It is not the probability of having experienced the event by time \(t\).

In observed data, define \(D_{it}=Y_{it}-Y_{i,t-1}\), the event indicator for person \(i\) in interval \(t\), and \(R_{it}=I(Y_{i,t-1}=0)\), the indicator that the person is at risk at the interval’s start. Only rows with \(R_{it}=1\) contribute to the event model. If a person experiences the event, they contribute no later person-period rows. A person lost to follow-up contributes no rows after censoring.

From Longitudinal Data to Weighted Person-Period Records

The treatment weight attached to an interval reflects the person’s observed treatment history up to that interval. To describe it, let \(V_i\) denote baseline covariates, \(L_{it}\) time-varying covariates measured before treatment \(A_{it}\), and \(C_{it}=0\) indicate remaining uncensored through interval \(t\). A stabilized treatment weight through \(t\) has the general form

$$ SW^A_{it}= \prod_{k=1}^{t} \frac{P(A_{ik}\mid \bar A_{i,k-1},V_i)} {P(A_{ik}\mid \bar A_{i,k-1},\bar L_{ik},V_i)}. $$

The denominator models the observed treatment given the measured treatment and covariate history; the numerator is a less conditional model used to stabilize the weights. If censoring is informative, an inverse-probability-of-censoring factor is also accumulated through \(t\), producing a combined weight \(W_{it}\). A person-period row is weighted by the cumulative weight through that interval, not merely by the weight for the treatment received in the current interval.

The weights aim to create a pseudo-population in which treatment assignment is independent of measured time-varying confounders, subject to the weighting model and identification assumptions. They do not literally create new people, and a weight is not a probability that an individual belongs to a treatment group.

Worked Example: Building Weighted Person-Period Rows

Suppose two hypothetical participants are followed for at most two intervals. Both are event-free and uncensored at the start of each interval shown. For participant A, the observed treatment at interval 1 has numerator probability \(0.80\) and denominator probability \(0.40\); at interval 2, the observed untreated status has probabilities \(0.70\) and \(0.50\). Participant B is untreated at interval 1, with probabilities \(0.20\) and \(0.60\), and treated at interval 2, with probabilities \(0.30\) and \(0.50\). Ignore censoring weights for this calculation.

For A, the interval-1 weight is \(0.80/0.40=2.00\). The interval-2 incremental ratio is \(0.70/0.50=1.40\), so A’s cumulative weight through interval 2 is \(2.00(1.40)=2.80\). For B, the first ratio is \(0.20/0.60=0.3333\). The second is \(0.30/0.50=0.6000\), giving a cumulative interval-2 weight of \(0.3333(0.6000)=0.2000\).

PersonIntervalObserved treatmentEvent in intervalAt risk?Cumulative weight
A110Yes2.00
A201Yes2.80
B100Yes0.3333
B210Yes0.2000

A’s event in interval 2 means A has no row for interval 3. The table is a fragment of a person-period data set, not a complete analysis: estimating causal effects requires adequate data, appropriate treatment and censoring models, and the identification conditions described below.

Specifying the Pooled Logistic MSM

A pooled logistic MSM models the counterfactual hazard under treatment histories. For example, if the scientific comparison is between sustained treatment \(a=1\) and sustained no treatment \(a=0\), one model is

$$ \operatorname{logit}\{h_t(a)\}=\alpha_t+\beta a,\qquad t=1,\ldots,K, $$

where \(h_t(a)\) is the hazard in interval \(t\) under the sustained regime \(a\), and \(\alpha_t\) allows the baseline hazard to vary by interval. In a more general MSM, the predictors can represent treatment history or a specified regime, rather than only a single sustained-treatment indicator. A constant \(\beta\) in this example asserts that the treatment log-odds contrast is the same at each interval; it does not assert that hazards or risks are constant over time.

The observed-data fit uses time and treatment-history predictors for each at-risk row and weights that row by \(W_{it}\). In a logistic model, the weighted estimating equation has the form

$$ \sum_i\sum_{t=1}^{K}R_{it}W_{it}X_{it} \left[D_{it}-\operatorname{expit}(X_{it}^{\mathsf T}\beta)\right]=0, \qquad \operatorname{expit}(u)=\frac{1}{1+\exp(-u)}. $$

Here \(X_{it}\) is the vector of model predictors for that row, and the \(R_{it}\) factor excludes intervals in which the person is not at risk. The fitted coefficients determine estimated regime-specific hazards through the model. The equation displays the weighted score used to fit the model; it does not by itself establish that the fitted hazards are causal.

Identification conditions: Causal interpretation requires consistency (the observed outcome under a person’s observed treatment history agrees with the corresponding counterfactual outcome), sequential exchangeability given the measured histories, and positivity for the treatment choices required by the regimes being compared. Correctly specified treatment and, when needed, censoring weight models are also required for the intended weighting procedure. The MSM must adequately represent the regime-specific hazards being estimated. These conditions connect the weighted observed-data analysis to counterfactual hazards; weighting alone does not guarantee that connection.

Worked Example: Reading a Weighted Logistic Hazard Contrast

Consider a hypothetical, single-interval weighted analysis with a separate hazard for each treatment group. Suppose the total weight among treated people at risk is \(6\), of which \(3\) corresponds to event rows. In the untreated group, the total weight at risk is \(4\), of which \(1\) corresponds to an event row. The weighted hazards are the weighted event totals divided by the weighted totals at risk:

$$ \hat h(1)=\frac{3}{6}=0.5000,\qquad \hat h(0)=\frac{1}{4}=0.2500. $$

The fitted treatment log-odds contrast is

$$ \hat\beta =\operatorname{logit}(0.5000)-\operatorname{logit}(0.2500) =0-\log\left(\frac{0.25}{0.75}\right) =1.099. $$

Exponentiating gives an odds ratio of \(\exp(1.099)\approx 3.000\). In this hypothetical interval, the weighted hazard is \(0.5000\) under treatment and \(0.2500\) without treatment; the hazard odds are three times as large under treatment. This is a hazard odds ratio, not a risk ratio. With only one interval, the interval event probabilities equal the one-interval risks, but their odds ratio still differs from their risk ratio.

Hazard Contrasts and Cumulative-Risk Contrasts

A hazard describes an interval-specific chance among those still event-free at that interval’s start. Cumulative risk describes the chance of having experienced the event by the end of a series of intervals. To obtain cumulative risk under a regime, first calculate its hazards, then combine them through the survival probabilities. If \(h_t(a)\) is the hazard in interval \(t\) under regime \(a\), then

$$ P(Y_K^{a}=1)=1-\prod_{t=1}^{K}\{1-h_t(a)\}. $$

This identity follows by multiplying conditional probabilities of surviving each interval. Under regime \(a\), the chance of surviving through interval \(K\) is the chance of surviving interval 1 multiplied by the chance of surviving interval 2 given survival through interval 1, and so on. Each conditional survival probability is \(1-h_t(a)\); subtracting their product from one gives the cumulative event risk.

Worked Example: Converting Hazards Into Cumulative Risks

Suppose a hypothetical fitted MSM has a constant treatment odds ratio of \(1.5\) in each interval, with control hazards \(0.10\), \(0.20\), and \(0.25\). For a control hazard \(h\), the corresponding treated hazard under an odds ratio of \(1.5\) is

$$ h(1)=\frac{1.5h(0)}{1-h(0)+1.5h(0)}. $$

Thus the treated hazards are \(0.150/(0.900+0.150)=0.1429\), \(0.300/(0.800+0.300)=0.2727\), and \(0.375/(0.750+0.375)=0.3333\). The cumulative control risk through interval 3 is

$$ 1-(1-0.10)(1-0.20)(1-0.25) =1-(0.90)(0.80)(0.75) =0.4600. $$

The treated cumulative risk is

$$ 1-(1-0.1429)(1-0.2727)(1-0.3333) \approx 1-(0.8571)(0.7273)(0.6667) \approx 0.5844. $$

The cumulative risk ratio is approximately \(0.5844/0.4600=1.270\). The interval-specific hazard odds ratio is \(1.5\), while the cumulative risk ratio is about \(1.270\). They differ because cumulative risk combines hazards across intervals, and the people at risk in later intervals are those who remained event-free earlier.

What the Model Does—and Does Not—Say

The pooled logistic MSM is useful when follow-up is naturally divided into intervals and treatment changes over time. It lets the analyst describe how treatment regimes relate to each interval’s counterfactual hazard, while weights address measured time-varying confounding under the stated assumptions. From the estimated hazards, cumulative risks can be calculated for a chosen follow-up horizon, making it possible to report both interval-specific and overall contrasts.

The hazard comparison is conditional on remaining event-free. It therefore compares regime-specific hazards in regime-specific risk sets, not necessarily the same subset of individuals at every interval. A hazard odds ratio is not automatically a risk ratio, and a coefficient from the logistic MSM should not be described as a cumulative-risk contrast. To report a risk contrast, calculate the regime-specific cumulative risks first, then form the desired difference or ratio.

Key takeaway: A pooled logistic MSM fits weighted event indicators on at-risk person-period rows. Its fitted hazards describe interval-specific counterfactual event probabilities under treatment regimes; cumulative risks require combining those hazards across intervals.

Common Mistake

A common error is to exponentiate the treatment coefficient from a pooled logistic MSM and call the result a cumulative risk ratio. In the sustained-treatment model, \(\exp(\beta)\) is an odds ratio for the interval-specific hazards, under the model’s constant-effect specification. It is not the ratio of the probabilities of experiencing the event by the end of follow-up. The correction is to predict each regime’s hazard at each interval, calculate \(1-\prod_t(1-h_t)\) for each regime, and then compare those cumulative risks on the desired scale.

Check Your Understanding

Use the definitions and calculations in this tutorial to answer the following questions.

  1. Why does a person who experiences the event in interval 2 contribute no at-risk row for interval 3?
  2. In a stabilized treatment weight, what roles do the numerator and denominator probabilities play?
  3. In a pooled logistic MSM with a time-specific intercept and one treatment coefficient, what does exponentiating the treatment coefficient represent?
  4. If a regime has hazards \(0.10\) and \(0.20\) in two intervals, calculate its cumulative risk through interval 2.
  5. Why can a hazard odds ratio differ from the cumulative risk ratio through several intervals?
Clinical Biostats