Tutorials › Marginal Structural Models › Time-Specific Intercepts in Pooled Logistic Models

Inverse Probability of Treatment Weights · Tutorial 91 of 501

Time-Specific Intercepts in Pooled Logistic Models

Estimate a pooled logistic treatment model with time-specific intercepts and interpret its fitted probabilities and odds contrasts at each decision time.

Advanced 10 min read

What You'll Learn

  • Specify a pooled logistic treatment model with one intercept adjustment for each decision time.
  • Interpret fitted probabilities at reference covariate values without confusing them with marginal probabilities.
  • Derive the time-specific intercept estimates in an intercept-only example.
  • Explain the common-slope assumption and what time contrasts mean on the odds scale.
  • Identify diagnostics and failure modes, including pooling periods with different treatment probabilities.
  • Check fitted time-specific probabilities using worked calculations and practice problems.

Why Give Each Decision Time Its Own Intercept?

In a longitudinal study, the chance of receiving treatment can change from one decision time to another. A treatment may become more common as clinical practice changes, or less common as eligibility narrows. A pooled logistic model represents the repeated treatment decisions in one regression, but a single intercept would force the same treatment probability at every time for people with the same covariates. Time indicators remove that restriction while retaining one pooled model.

Let \(A_{it}\) be the binary treatment for individual \(i\) at decision time \(t\), where \(t=1,\ldots,K\). Let \(R_{it}=1\) indicate that individual \(i\) remains eligible and observed for treatment assignment at time \(t\), and let \(H_{it}\) denote the measured history available just before that assignment. This history may include covariates and past treatment. The model below describes the conditional probability of treatment among those at risk; it does not by itself establish causal identification.

Definition: A pooled logistic treatment model with time-specific intercepts and shared covariate effects is $$ \operatorname{logit} P(A_{it}=1\mid H_{it},R_{it}=1) = \alpha_0+\sum_{k=2}^{K}\alpha_k I(t=k)+\beta^\top Z_{it}, $$ where \(Z_{it}\) is the chosen vector of predictors from \(H_{it}\), and time 1 is the reference time. The intercept at time 1 is \(\alpha_0\); at time \(k\) it is \(\alpha_0+\alpha_k\). The coefficient vector \(\beta\) is shared across times. The fitted probability is obtained by applying the inverse-logit function to the linear predictor.

The intercept is conditional on the covariates being at their reference values, not automatically a population-average or marginal treatment probability. If \(Z_{it}\) contains continuous variables, setting them to zero may describe an implausible individual. Centering them at meaningful values makes the intercept easier to interpret without changing fitted probabilities.

What the Time Coefficients Mean

With time 1 as the reference, \(\alpha_k\) is the change in conditional log odds at time \(k\) relative to time 1, holding \(Z_{it}\) fixed. Equivalently, \(\exp(\alpha_k)\) is the conditional odds ratio comparing treatment at time \(k\) with treatment at time 1 for the same covariate values. This is an odds-scale comparison; it is not a difference in probabilities.

Because the model has no treatment-by-time interaction, it assumes the covariate coefficients are shared across times. In particular, for a one-unit increase in a covariate \(Z_j\), the conditional odds ratio is \(\exp(\beta_j)\) at every decision time. The probability change need not be the same at each time: the inverse-logit transformation depends on the time-specific linear predictor.

Result: At fixed covariate values \(z\), the fitted odds at time \(k\) divided by the fitted odds at time 1 equal \(\exp(\alpha_k)\). To see this, the two linear predictors are \(\eta_k=\alpha_0+\alpha_k+\beta^\top z\) and \(\eta_1=\alpha_0+\beta^\top z\). Since odds equal \(\exp(\eta)\), $$ \frac{\exp(\eta_k)}{\exp(\eta_1)} = \exp(\eta_k-\eta_1) = \exp(\alpha_k). $$ Thus the contrast is constant across \(z\) on the odds scale, even though the corresponding probability contrast generally varies with \(z\). \(\square\)

Worked Example: Converting Intercepts to Time-Specific Probabilities

Suppose there are three decision times and the fitted model is \(\operatorname{logit} P(A_{it}=1\mid H_{it},R_{it}=1)=0.2-0.8I(t=2)+0.5I(t=3)+0.6Z_{it}\). Calculate the fitted probabilities for \(Z_{it}=0\) and \(Z_{it}=1\), and interpret the time coefficients.

At \(Z_{it}=0\), the linear predictors at times 1, 2, and 3 are \(0.2\), \(0.2-0.8=-0.6\), and \(0.2+0.5=0.7\). Applying \(\operatorname{expit}(x)=1/(1+\exp(-x))\) gives:

$$ \begin{aligned} \hat p_1(0)&=\frac{1}{1+\exp(-0.2)}\approx 0.5498,\\ \hat p_2(0)&=\frac{1}{1+\exp(0.6)}\approx 0.3543,\\ \hat p_3(0)&=\frac{1}{1+\exp(-0.7)}\approx 0.6682. \end{aligned} $$

For \(Z_{it}=1\), add \(0.6\) to each time-specific linear predictor. The resulting predictors are \(0.8\), \(0.0\), and \(1.3\), so the probabilities are approximately \(0.6900\), \(0.5000\), and \(0.7858\). The time coefficients imply odds ratios \(\exp(-0.8)\approx0.4493\) for time 2 versus time 1, and \(\exp(0.5)\approx1.6487\) for time 3 versus time 1, holding \(Z_{it}\) fixed. The probability changes are not those odds ratios.

Likelihood and Estimation

For each at-risk person-time row, let \(p_{it}(\theta)\) denote the model probability, where \(\theta=(\alpha_0,\alpha_2,\ldots,\alpha_K,\beta^\top)^\top\). The conditional Bernoulli likelihood for observed treatment decisions is

$$ L(\theta)= \prod_i\prod_{t:R_{it}=1} p_{it}(\theta)^{A_{it}} \{1-p_{it}(\theta)\}^{1-A_{it}}. $$

This is the sequential treatment likelihood: each factor conditions on the measured history available before that decision. Repeated rows from the same person are not thereby asserted to be marginally independent. Standard logistic regression software can maximize the corresponding log-likelihood, with time represented as a categorical predictor. The fitted model requires an identifiable design matrix and a finite maximum; empty time categories, exact collinearity, or complete or quasi-complete separation can prevent ordinary maximum-likelihood estimates from being finite.

Worked Example: Hand Calculation in an Intercept-Only Model

Suppose 100 people are at risk at each of three times, with 30, 50, and 20 treated, respectively. Fit the model with time indicators and no other predictors, using time 1 as reference.

For a time category with \(y\) treated out of \(n\), its Bernoulli log-likelihood as a function of its treatment probability \(p\) is \(y\log(p)+(n-y)\log(1-p)\). Differentiating gives \(y/p-(n-y)/(1-p)\). Setting this equal to zero yields \(y(1-p)=(n-y)p\), hence \(\hat p=y/n\). The fitted probabilities are therefore \(0.30\), \(0.50\), and \(0.20\).

The time-1 intercept is the logit of \(0.30\): \(\hat\alpha_0=\log(0.30/0.70)\approx-0.8473\). The time-2 coefficient is the logit difference \(\hat\alpha_2=\log(0.50/0.50)-\log(0.30/0.70)\approx0.8473\). The time-3 coefficient is \(\hat\alpha_3=\log(0.20/0.80)-\log(0.30/0.70)\approx-0.5390\). Checking, \(\operatorname{expit}(-0.8473)\approx0.30\); \(\operatorname{expit}(-0.8473+0.8473)=0.50\); and \(\operatorname{expit}(-0.8473-0.5390)\approx0.20\).

The calculation illustrates a general result for an intercept-only model with one time indicator category per decision time: the maximum-likelihood fitted probability in each category is its observed treatment proportion, provided each category contains both treated and untreated observations. The derivation above establishes the result by maximizing each category’s Bernoulli likelihood separately. With covariates, the same proportions need not be the model’s fitted probabilities for any particular covariate pattern.

Worked Example: Changing the Reference Time

Use the proportions from the preceding example, but now choose time 2 as the reference category. The time-2 intercept is \(\operatorname{logit}(0.50)=0\). The coefficient for time 1 is \(\operatorname{logit}(0.30)-\operatorname{logit}(0.50)\approx-0.8473\), and the coefficient for time 3 is \(\operatorname{logit}(0.20)-\operatorname{logit}(0.50)\approx-1.3863\).

The fitted logits are \(-0.8473\) at time 1, \(0\) at time 2, and \(-1.3863\) at time 3. Applying the inverse logit returns \(0.30\), \(0.50\), and \(0.20\). Changing the reference time changes the coefficient labels and values, but not the fitted probabilities or contrasts between times. For example, the time-3 versus time-1 log-odds contrast remains \(-1.3863-(-0.8473)=-0.5390\).

Diagnostics, Limitations, and a Common Pitfall

Check the number of at-risk observations and treated decisions at each time before fitting. Very small counts can make time-specific intercepts unstable; a category with only treated or only untreated observations can produce separation. After fitting, compare observed and predicted treatment proportions by time, and examine calibration within important covariate groups. A close match to the overall proportion at each time does not guarantee good conditional predictions: covariate patterns can be poorly represented even when aggregate calibration looks acceptable.

The pooled specification is economical because it estimates one shared covariate coefficient vector rather than separate coefficients at every time. Its limitation is the shared-slope assumption. If covariate associations with treatment change across times, the model may misstate conditional treatment probabilities. The time-specific intercepts account for shifts common to all covariate patterns on the log-odds scale, but cannot repair a wrong covariate-effect structure. Inference must also respect the repeated-person structure when estimating uncertainty; treating every row as an independent person can give inappropriate standard errors.

  • Common mistake: “The time-2 coefficient is \(-0.8\), so treatment probability falls by 80 percentage points.” This confuses a log-odds coefficient with a probability difference. The coefficient is a log-odds contrast; exponentiating it gives an odds ratio, and probabilities must be calculated from the full linear predictor.
  • Common mistake: “A pooled model has one intercept, so the treatment probability is constant over time.” A model with time indicators has an intercept at each time, formed by adding the relevant indicator coefficient to the reference intercept.
  • Common mistake: “The intercept is the average treatment probability.” It is the conditional log odds at the reference covariate values. Averaging predicted probabilities over a target population is a separate calculation.

A single common intercept is a more restrictive alternative: it assumes no time shift after conditioning on modeled covariates. Separate models by time allow all coefficients to vary, but use more parameters and may be unstable with limited data. Time-specific intercepts occupy the middle ground: they allow the overall conditional treatment level to shift by time while retaining common covariate effects. The appropriate choice depends on the scientific structure and the available data, not on whether one model is always preferable.

Check Your Understanding

Work through each question, then compare with the solutions.

  1. A fitted model has reference-time intercept \(-1\) and time-2 coefficient \(0.4\), with all covariates at their reference values. What is the time-2 fitted probability and the time-2 versus reference-time odds ratio?
  2. Why can a model with time-specific intercepts have different treatment probabilities at two times even when covariates are identical?
  3. In an intercept-only model, 40 of 80 people are treated at time 1. What is the fitted time-1 intercept?
  4. What does the shared-slope assumption say about the effect of a one-unit increase in a covariate on the odds across decision times?

Solutions. (1) The time-2 logit is \(-1+0.4=-0.6\), so the probability is \(1/(1+\exp(0.6))\approx0.3543\). The odds ratio is \(\exp(0.4)\approx1.4918\). (2) The time indicator changes the linear predictor by its time coefficient, which changes the inverse-logit probability. (3) The fitted proportion is \(40/80=0.5\), whose logit is \(\log(0.5/0.5)=0\). (4) The covariate’s conditional odds ratio is \(\exp(\beta_j)\) at each time; the shared coefficient does not imply equal probability differences across times.

Clinical Biostats