Why Depression Treatment Requires Longitudinal Analysis
Antidepressant decisions often respond to a patient’s recent symptom severity, response to earlier treatment, and adverse effects. Those same factors can predict later remission. A patient whose symptoms remain severe may be more likely to receive treatment or a dose change, while adverse effects may prompt stopping or switching. Because earlier treatment can itself affect later symptoms and adverse effects, these variables are both consequences of prior treatment and confounders of later treatment.
The estimand in this case study is the population probability of remission under each of two sustained treatment strategies. This is a marginal question: what proportion would be in remission if everyone followed one strategy, compared with the proportion if everyone followed the other? It is not the conditional association between treatment and remission among patients with the same observed symptom scores.
The strategies must be clinically interpretable and sufficiently well defined for consistency to make sense. In an actual protocol, “treatment” must specify the relevant drug or drug class, allowed dose and titration rules, and how treatment is assessed at each visit. The binary notation is a simplification, not a reason to combine materially different treatment versions without justification. The time order is essential: \(L_t\) is measured before \(A_t\), and \(L_{t+1}\) follows \(A_t\).
From Clinical Histories to Causal Risks
Write \(\bar L_t=(L_0,\ldots,L_t)\) and \(\bar A_{t-1}=(A_0,\ldots,A_{t-1})\). The observed history just before treatment at time \(t\) is \(H_t=(\bar L_t,\bar A_{t-1})\). For each sustained strategy \(\bar a\), let \(Y^{\bar a}\) denote the remission outcome that would be observed if that strategy were followed. The target risks are \(P(Y^{\bar 1}=1)\) and \(P(Y^{\bar 0}=1)\); a risk difference is \(P(Y^{\bar 1}=1)-P(Y^{\bar 0}=1)\).
Identification from observational data requires the following conditions. They are substantive assumptions, not properties that a statistical model can guarantee.
- Consistency and well-defined treatment: for a patient whose observed treatment history is \(\bar a\), the observed outcome equals \(Y^{\bar a}\). The recorded treatment must correspond to the strategy being studied.
- Sequential exchangeability: at each decision time, conditional on \(H_t\), treatment assignment is independent of the potential outcomes and future covariates relevant to the specified strategies. In this application, this requires measuring the symptom and adverse-effect information, and other common causes of treatment and remission, that clinicians use at that time.
- Positivity: for every history that can arise under a strategy in the target population, the probability of the strategy’s treatment at that time is positive. For binary treatment, both treatment choices must be possible at relevant histories when comparing both strategies.
- No interference: one patient’s treatment does not change another patient’s remission outcome.
For clarity, the formulas below use discrete covariates and complete follow-up. For continuous covariates, sums are replaced by integrals. If follow-up is incomplete, censoring needs its own appropriate assumptions and adjustment; treating loss to follow-up as if it were ordinary treatment assignment does not solve that problem.
Worked Example: Ordering a Patient’s Treatment History
Suppose visits occur at \(t=0,1,2\). At each visit, the clinician records a symptom score and whether the patient reported a limiting adverse effect, then records treatment for the next interval. One patient has scores \(18,14,9\), adverse effects \(0,1,0\), and treatment history \(1,1,1\). The endpoint remission indicator is \(Y=1\).
At \(t=1\), the history used to model treatment is \(H_1=(L_0,L_1,A_0)\), where \(L_0\) and \(L_1\) each contain the score and adverse-effect information recorded before the decision. It includes the first treatment \(A_0=1\), since earlier treatment could have affected the current symptoms and adverse effects. It does not include \(A_1\), which is the decision being modelled.
Suppose the fitted treatment probabilities for this patient’s observed history are \(P(A_0=1\mid H_0)=0.70\), \(P(A_1=1\mid H_1)=0.50\), and \(P(A_2=1\mid H_2)=0.40\). For the observed all-treatment path, the inverse-probability weight is \(1/(0.70\times0.50\times0.40)=1/0.14\approx7.14\). This weight reflects how uncommon that treatment path was given the patient’s measured histories. It does not mean the patient has a 7.14-fold probability of remission.
Identification by the Longitudinal G-Formula
Under consistency, sequential exchangeability, positivity, and no interference, the strategy-specific risk is identified by the longitudinal g-formula. With \(L_0\) measured before the first treatment and \(L_{t+1}\) measured after \(A_t\), its discrete form is:
Here \(\bar a_t=(a_0,\ldots,a_t)\). The formula averages the endpoint remission probability over the covariate histories that would arise under the specified strategy. Its identifying logic can be seen by following the history forward: the baseline distribution is observed, each subsequent covariate distribution is evaluated under the assigned treatment history, and the final outcome distribution is evaluated under the complete strategy.
By consistency, the baseline distribution under the intervention is the observed \(P(L_0=l_0)\), because treatment has not yet been assigned.
Given the history through \(L_t\), the intervention sets \(A_t=a_t\). Sequential exchangeability and consistency identify the next covariate distribution as \(P(L_{t+1}\mid \bar L_t=\bar l_t,\bar A_t=\bar a_t)\).
At the final history, consistency and exchangeability identify the remission probability as \(P(Y=1\mid \bar L_K=\bar l_K,\bar A_K=\bar a_K)\). Multiplying the sequential history probabilities and summing over all histories gives the displayed formula.
This argument is an application of the chain rule for the covariate history under the intervention. Positivity ensures the observed conditional distributions in the formula are defined for histories the intervention can generate. Therefore each factor is identified from observed data, and their product and sum identify the target risk. \(\square\)
Worked Example: Standardizing Over Symptom Histories
Consider a simplified setting with one post-baseline symptom measure \(L_1\), classified as low or high severity. Suppose the g-formula inputs under sustained treatment are \(P(L_1=\text{low}\mid\bar 1)=0.70\) and \(P(L_1=\text{high}\mid\bar 1)=0.30\). The corresponding endpoint remission probabilities are \(0.65\) and \(0.35\). Then:
Under sustained no treatment, suppose \(P(L_1=\text{low}\mid\bar 0)=0.40\), \(P(L_1=\text{high}\mid\bar 0)=0.60\), and the remission probabilities at those histories are \(0.40\) and \(0.15\). Then:
The resulting risk difference is \(0.56-0.25=0.31\), or 31 percentage points. These numbers are illustrative model inputs, not estimates from a real depression cohort. The calculation shows why the distribution of symptoms under each strategy matters: the two risks average over different symptom histories.
Inverse-Probability Weighting for Sustained Strategies
An alternative is to weight patients who followed a strategy by the inverse probability of their observed treatment choices given their histories. For a patient following \(\bar a\), define \(W^{\bar a}=1/\prod_{t=0}^{K}P(A_t=a_t\mid H_t)\); for a patient who did not follow that strategy, set \(W^{\bar a}=0\). In practice, the probabilities are estimated, often with models that include symptom severity, adverse effects, and other treatment predictors in \(H_t\).
The corresponding normalized estimator of the strategy-specific remission risk is:
This is a weighted average among observed adherers to the strategy. The weighting corrects for the fact that, conditional on measured histories, some patients are more likely than others to follow that path. Under the identification assumptions and correctly specified treatment probability models, the population weighted mean identifies the strategy risk.
To verify the identity, factor the observed-data distribution into the baseline history, treatment probabilities, subsequent covariate distributions, and outcome distribution. Multiplication by \(W^{\bar a}\) cancels the treatment-probability factors on the path \(\bar A=\bar a\). The remaining distribution is the one that generates histories under the intervention: the baseline distribution, followed by covariate distributions conditional on the assigned past treatment. Consistency and sequential exchangeability identify these factors as the intervention’s covariate and outcome distributions. Consequently, \(E[W^{\bar a}Y]=P(Y^{\bar a}=1)\).
The same cancellation with \(Y\) replaced by 1 gives \(E[W^{\bar a}]=1\). Dividing the first identity by the second proves the result. In a finite sample, the normalized weighted estimator uses the estimated counterpart of this ratio. \(\square\)
Worked Example: Calculating a Weighted Remission Risk
Suppose four patients followed sustained treatment. Their estimated treatment probabilities at the three decisions, their endpoint remission outcomes, and their weights are:
| Patient | Decision probabilities | Remission \(Y\) | Weight |
|---|---|---|---|
| 1 | \(0.50, 0.50, 0.50\) | 1 | \(1/(0.50\times0.50\times0.50)=8\) |
| 2 | \(0.80, 0.50, 0.50\) | 1 | \(1/(0.80\times0.50\times0.50)=5\) |
| 3 | \(0.50, 0.40, 0.50\) | 0 | \(1/(0.50\times0.40\times0.50)=10\) |
| 4 | \(0.50, 0.50, 0.50\) | 0 | \(1/(0.50\times0.50\times0.50)=8\) |
The weighted numerator is \(8(1)+5(1)+10(0)+8(0)=13\). The sum of weights is \(8+5+10+8=31\). Thus the normalized weighted remission risk is \(13/31\approx0.419\), or about 42%. This small calculation illustrates the estimator; with four patients it is not a reliable clinical estimate. The comparison arm must be estimated separately using its own strategy weights.
Diagnostics, Alternatives, and Limitations
The main diagnostic concern is weak treatment overlap. If patients with severe symptoms and limiting adverse effects almost always stop treatment, the probability of sustained treatment for those histories may be close to zero. The resulting inverse probabilities are large, so a few patients can dominate the weighted estimate. Examine the distribution of estimated probabilities and weights, the largest weights, and the effective sample size; also check whether weighting improves balance in measured symptom and adverse-effect histories across treatment groups at each decision time. These checks can reveal instability or model problems, but they cannot establish that all confounders were measured.
The g-formula and inverse-probability weighting target the same marginal risks under the same causal assumptions, but rely on different modelling steps. The g-formula models covariate evolution and the outcome under treatment histories, then averages predicted outcomes over strategy-specific histories. Weighting models treatment assignment given history, then constructs a weighted population. Agreement can be reassuring, but neither method repairs unmeasured confounding or a poorly defined treatment strategy.
Ordinary regression that adjusts for current symptom severity can be misleading for the total effect of sustained treatment. Later symptoms may be affected by earlier treatment while also confounding later treatment; conditioning on them in a single outcome regression can block part of the earlier treatment effect while attempting to control confounding of later treatment. A baseline-only regression, in contrast, may leave later treatment confounding uncontrolled. Marginal structural model weighting is designed for this feedback structure, but its validity still depends on adequate measurement, positivity, model specification, and follow-up.
A further limitation is clinical interpretation. A sustained “treatment at every visit” regime may be unrealistic or unsafe for some patients, and a binary treatment indicator may conceal important differences in medication, dose, adherence, and switching. The analysis should state what happens under the strategy and who is represented by the target population. It should not be read as a recommendation to continue a medication despite serious adverse effects.
Common Mistake
Check Your Understanding
Answer each question, then compare with the solutions below.
- At decision time \(t=2\), which variables belong in the treatment history, and why should \(A_2\) not be included in that history?
- Suppose the probabilities of following a three-decision strategy are \(0.60\), \(0.50\), and \(0.40\). What is the inverse-probability weight for an adherent patient?
- In the standardization example, what is the sustained-treatment remission risk if the low- and high-severity probabilities are \(0.80\) and \(0.20\), and the corresponding remission probabilities remain \(0.65\) and \(0.35\)?
- Name two assumptions that cannot be verified merely by examining the estimated weight distribution.
Solutions. (1) The history is \(H_2=(L_0,L_1,L_2,A_0,A_1)\): covariates measured before decision 2 and earlier treatments. \(A_2\) is the treatment being assigned at that decision, so it is not a predictor in its own assignment history. (2) The weight is \(1/(0.60\times0.50\times0.40)=1/0.12\approx8.33\). (3) The risk is \(0.80(0.65)+0.20(0.35)=0.52+0.07=0.59\). (4) For example, no diagnostic can establish absence of unmeasured confounding or prove consistency for a clinically well-defined treatment strategy; these require substantive knowledge and design reasoning.