From Person-Period Data to Regime-Specific Risk
A pooled logistic survival model turns follow-up into a sequence of binary outcomes: for each interval in which a person is still at risk, did the event occur? Pooling these rows allows one regression model to describe the interval hazards. In a marginal structural model (MSM), the regression is fitted with treatment weights so that its treatment comparisons target specified intervention regimes, subject to the causal assumptions and model specification.
The task here is to follow that calculation all the way through: define the weighted likelihood, fit a small model from person-period totals, obtain interval hazards, and use them to calculate survival and risk. The worked data have complete event ascertainment for two intervals. In applications with censoring, appropriate handling of censoring is also needed; that is not built into this numerical example.
For the example, treatment \(A\) is assigned at baseline and remains the regime of interest throughout follow-up. Write \(W_{it}\) for the treatment weight on an at-risk person-period row, and let \(\eta_{it}\) be the model’s linear predictor. The weighted logistic log-likelihood, up to terms not involving the model parameters, is
This likelihood treats each row as a contribution conditional on being at risk at the interval’s start. A person who has the event contributes no later rows. The regression’s fitted value is an interval hazard, not a cumulative risk.
Worked Fit from Exact Weighted Totals
Consider a two-interval MSM with a separate baseline hazard for each interval and a treatment effect that can differ by interval. Use the model
where \(q_t^a\) is the model-predicted event hazard in interval \(t\) under treatment regime \(a\in\{0,1\}\). The following table gives exact weighted totals. The interval 2 risk total equals the interval 1 survivors within each treatment group.
| Interval | Treatment \(A\) | At-risk weight total | Event weight total | Survivor weight total |
|---|---|---|---|---|
| 1 | 0 | 1,000 | 100 | 900 |
| 1 | 1 | 1,000 | 200 | 800 |
| 2 | 0 | 900 | 180 | 720 |
| 2 | 1 | 800 | 240 | 560 |
These are exact totals, not rounded representations of other values. For example, the interval 2 hazard fraction for \(A=1\) is exactly \(240/800=0.3\). In each of the four interval-by-treatment cells, the fitted hazard must equal its event weight total divided by its at-risk weight total: the model is saturated for these four cells.
Worked Example: Recovering the Pooled Logistic Coefficients
Calculate the four cell hazards and show that the coefficients below reproduce them exactly.
For interval 1, the hazards are \(100/1000=0.1\) for \(A=0\) and \(200/1000=0.2\) for \(A=1\). For interval 2, they are \(180/900=0.2\) for \(A=0\) and \(240/800=0.3\) for \(A=1\). Their logits are, respectively, \(-\log 9\), \(-\log 4\), \(-\log 4\), and \(\log(3/7)\).
The \(A=0\) logits directly give \(\alpha_1=-\log 9\) and \(\alpha_2=-\log 4\). The treatment effect in interval 1 is the difference between the two interval 1 logits: \( \beta=-\log 4-(-\log 9)=\log(9/4)\). In interval 2, the treatment effect is \(\beta+\delta_2\), so \( \delta_2=\log(3/7)-(-\log 4)-\log(9/4)=\log(16/21)\).
A direct substitution checks the result. For interval 1 and \(A=1\), the linear predictor is \(-\log 9+\log(9/4)=-\log 4\), whose logistic transform is \(1/5=0.2\). For interval 2 and \(A=1\), it is \(-\log 4+\log(9/4)+\log(16/21)=\log(3/7)\), whose logistic transform is \(3/(3+7)=0.3\). The other two predictions are \(0.1\) and \(0.2\), as calculated from their logits.
The exactness matters: the weighted cell residual is the observed event weight total minus the fitted event weight total. Here each fitted event total is exactly the risk total multiplied by the corresponding hazard. Thus the four residuals are zero, rather than merely close to zero after rounding.
Why These Coefficients Maximize the Weighted Likelihood
The cell calculations are not only a way to propose coefficients. They establish the maximum of the weighted likelihood for this saturated model, provided each of the four cells has positive risk and has both events and non-events. To see this, consider one cell with risk weight total \(r>0\), event weight total \(e\), and fitted hazard \(p\), where \(0<e<r\). Its log-likelihood contribution, as a function of \(p\), is
Differentiating gives \(e/p-(r-e)/(1-p)\), which is zero exactly when \(p=e/r\). The second derivative is \(-e/p^2-(r-e)/(1-p)^2<0\) for \(0<p<1\), so this is the unique maximum in that cell. The four cell probabilities can be represented freely by the four parameters in the stated saturated model: each interval has its own intercept, and the treatment coefficient and interval 2 interaction allow a separate treatment contrast in each interval. Maximizing each cell contribution therefore maximizes the full weighted likelihood. Because all four event fractions are strictly between zero and one, the maximum is finite and unique in cell probabilities. This argument depends on the exact totals and does not claim that arbitrary rounded summaries give zero residuals. \(\square\)
This saturated result is specific to a model with one free fitted hazard per interval-by-treatment cell. With fewer parameters, the fitted hazards generally will not equal all four observed cell fractions; they are then determined jointly by the weighted likelihood.
From Interval Hazards to Survival and Risk
For a treatment regime \(a\), let \(q_t^a\) denote the probability of the event in interval \(t\), conditional on being event-free at its start under that regime. The survival probability through interval \(K\) is the probability of surviving each interval in sequence.
To justify the result, let \(S_t^a\) be the probability of being event-free through interval \(t\), with \(S_0^a=1\). By the definition of the conditional hazard, \(P(\text{survive interval }t\mid\text{event-free at its start under }a)=1-q_t^a\). The chain rule gives \(S_t^a=S_{t-1}^a(1-q_t^a)\). Applying this equality successively from \(t=1\) through \(K\) yields \(S_K^a=\prod_{t=1}^K(1-q_t^a)\). The event by the end of interval \(K\) is the complement of surviving through \(K\), so \(R_K^a=1-S_K^a\). This calculation requires hazards defined on the successive event-free risk sets; it does not require the hazards to be constant across time. \(\square\)
Worked Example: Computing Two-Interval Regime Risks
Use the fitted hazards to calculate survival and cumulative risk through interval 2 under each treatment regime, then compare the risks.
Under \(A=0\), the interval hazards are \(q_1^0=0.1\) and \(q_2^0=0.2\). Therefore, \(S_2^0=(1-0.1)(1-0.2)=0.9(0.8)=0.72\), and \(R_2^0=1-0.72=0.28\).
Under \(A=1\), the hazards are \(q_1^1=0.2\) and \(q_2^1=0.3\). Thus \(S_2^1=(1-0.2)(1-0.3)=0.8(0.7)=0.56\), and \(R_2^1=1-0.56=0.44\).
The risk difference, defined here as risk under \(A=1\) minus risk under \(A=0\), is \(0.44-0.28=0.16\), or 16 percentage points. The risk ratio is \(0.44/0.28=11/7\), approximately \(1.571\). These are contrasts through interval 2; neither is an interval-specific treatment effect.
For this fitted MSM to support a causal interpretation, the intervention regimes must be well-defined, consistency must connect observed outcomes to outcomes under the received regime, and treatment exchangeability and positivity must support the weighting strategy. The weights and outcome model must also be correctly specified for the claimed target. The calculations above transform fitted model predictions; they do not by themselves establish those assumptions.
Interpreting Predictions and Checking the Fit
Worked Example: Converting Fitted Odds to an Interval Hazard
For \(A=1\) in interval 2, the fitted linear predictor is \(\log(3/7)\). Its exponentiation, \(3/7\), is the fitted odds, not the hazard. The hazard is the logistic transform: \(q_2^1=(3/7)/(1+3/7)=3/10=0.3\). Consequently, the conditional probability of surviving interval 2 is \(1-0.3=0.7\), not \(1-3/7\).
This distinction is consequential when combining intervals. Using the odds \(3/7\) as if they were a hazard would give an incorrect survival product and an incorrect cumulative risk, even though the model’s linear predictor and odds had been calculated correctly.
A practical check is to compare fitted and observed weighted event totals within intervals and treatment groups when the model is saturated, and to examine weighted residual patterns, fitted probabilities, and the distribution of weights in less saturated models. Large weights can make a few rows dominate the fit; sparse events or empty cells can prevent finite estimates or make them highly sensitive to small data changes. Lack of overlap in treatment support is not repaired by obtaining a numerical regression solution.
Confirm that only event-free individuals contribute to an interval and that an event row is not followed by additional at-risk rows.
Inspect weight ranges and whether the treatment regimes have adequate representation across the modeled intervals. Extreme weights or thin cells can undermine stable estimation.
Confirm predictions lie between zero and one. For a saturated model, verify that predicted weighted event totals equal the exact cell totals; otherwise do not assume zero residuals.
Use one minus each interval hazard in the survival product, then subtract survival from one to obtain cumulative risk.
The weighted Cox survival MSM is a continuous-time alternative, while the pooled logistic model represents hazards over explicitly defined intervals. Their connection and differences depend in part on interval width; a complementary log-log link is another discrete-interval modeling choice. These alternatives do not change the basic requirement that a survival prediction be built from the hazard on each successive risk set. Pooled logistic predictions also depend on the chosen interval construction and model form, so the fitted hazards and cumulative risks should be interpreted on that scale and over the follow-up horizon actually modeled.
Common Mistakes and Limitations
- Reading odds as hazards. Exponentiating a logistic linear predictor gives odds. Apply \(x/(1+x)\) to odds \(x\) to recover the probability.
- Adding interval hazards to get cumulative risk. Hazards condition on survival to different interval starts. Multiply interval survival probabilities, then take the complement.
- Claiming exact fit from rounded totals. A rounded event fraction need not equal the fraction implied by proposed coefficients. Either use exact totals, as above, or describe the fit and residuals as approximate.
- Treating a model fit as proof of causal identification. Weighted estimation and correct arithmetic do not replace exchangeability, positivity, consistency, and suitable model assumptions.
Finally, the numerical example uses only two intervals and a saturated treatment-by-interval specification. A richer follow-up schedule, a constrained treatment effect, additional predictors, or incomplete follow-up requires additional modeling and checks. Uncertainty in estimated risks must also account for the design and the estimation procedure; point predictions alone do not convey their precision.
Check Your Understanding
Try each question, then check the solutions below.
- If a cell has weighted risk total 500 and weighted event total 75, what is its fitted hazard in a saturated cell model?
- If two interval hazards are 0.25 and 0.10, what are survival and cumulative risk through interval 2?
- A fitted logit is \(\log(2/3)\). What are the fitted odds and hazard?
- Why does a zero-residual exact-fit claim require care when the displayed weighted totals have been rounded?
Solutions. (1) The hazard is \(75/500=0.15\). (2) Survival is \((1-0.25)(1-0.10)=0.75(0.90)=0.675\), so risk is \(1-0.675=0.325\). (3) The odds are \(2/3\); the hazard is \((2/3)/(1+2/3)=2/5=0.4\). (4) Rounded totals can change the event-to-risk fraction, so coefficients that match an unrounded fraction may not yield exactly zero residuals for the printed numbers. Exact claims must use exact underlying totals, or be stated as approximate for rounded summaries.