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.
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
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\).
| Person | Interval | Observed treatment | Event in interval | At risk? | Cumulative weight |
|---|---|---|---|---|---|
| A | 1 | 1 | 0 | Yes | 2.00 |
| A | 2 | 0 | 1 | Yes | 2.80 |
| B | 1 | 0 | 0 | Yes | 0.3333 |
| B | 2 | 1 | 0 | Yes | 0.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
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
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.
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:
The fitted treatment log-odds contrast is
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
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
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
The treated cumulative risk is
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.
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.
- Why does a person who experiences the event in interval 2 contribute no at-risk row for interval 3?
- In a stabilized treatment weight, what roles do the numerator and denominator probabilities play?
- In a pooled logistic MSM with a time-specific intercept and one treatment coefficient, what does exponentiating the treatment coefficient represent?
- If a regime has hazards \(0.10\) and \(0.20\) in two intervals, calculate its cumulative risk through interval 2.
- Why can a hazard odds ratio differ from the cumulative risk ratio through several intervals?