Why Visit-Specific Coefficients Can Be Different Comparisons
In longitudinal data, a treatment coefficient is not meaningful without specifying both which visit it concerns and which covariates are held fixed. At one visit the adjustment set might contain baseline covariates; at a later visit it might also contain a time-varying covariate measured before that treatment decision. Those models condition on different histories, and may compare treated and untreated people in different parts of the covariate distribution.
A difference between visit-specific coefficients can therefore arise even when the conditional treatment contrasts have not changed. Treatment prevalence, covariate distributions, and the amount of treatment overlap within covariate strata can all change over time. Conversely, matching coefficients do not establish that the visits represent the same comparison.
Let \(A_t\) denote treatment at visit \(t\), \(L_t\) a covariate measured before that visit’s treatment decision, and \(Y_t\) an outcome measured afterward. Write \(C_t\) for the covariates included in a particular regression at visit \(t\). The comparison of interest in this tutorial is a regression coefficient for \(A_t\), conditional on \(C_t\); it is not automatically the effect of a treatment regime.
The earlier material on treatment-by-confounder interactions established why a treatment effect may vary across covariate levels. Here the focus is on what a coefficient from a model without that interaction represents, and why that representation may change across visits.
What a Common Adjusted Coefficient Weights
First consider a single visit and a categorical covariate \(C\) with finitely many strata \(g\). Let \(p_g=P(C=g)>0\), let \(e_g=P(A=1\mid C=g)\), and suppose \(0<e_g<1\) in every stratum. Assume finite second moments and the conditional mean model \(E[Y\mid A,C=g]=m_g+\delta_g A\). Fit the population least-squares regression of \(Y\) on an intercept, indicators for \(C\), and \(A\), with no \(A\)-by-\(C\) interaction.
Proof. In the population regression, removing the stratum indicators from \(A\) leaves the residual \(A-e(C)\), where \(e(C)=P(A=1\mid C)\). This follows because the least-squares prediction of a binary \(A\) using stratum indicators is its mean within each stratum. The Frisch–Waugh–Lovell theorem therefore gives \[ \beta=\frac{E[(A-e(C))Y]}{E[(A-e(C))A]}. \] For a stratum \(g\), the conditional mean of \(A-e_g\) is zero, so the term involving \(m_g\) contributes nothing to the numerator. Since \(A\) is binary, \[ E[(A-e_g)Y\mid C=g] =e_g(1-e_g)E[Y\mid A=1,C=g] -e_g(1-e_g)E[Y\mid A=0,C=g] =e_g(1-e_g)\delta_g. \] Also, \[ E[(A-e_g)A\mid C=g] =e_g-e_g^2=e_g(1-e_g). \] Averaging these expressions over the strata gives the stated numerator and denominator. The denominator is positive because \(p_g>0\) and \(0<e_g<1\). Dividing proves the formula. \(\square\)
This result clarifies two features of the coefficient. First, a stratum with little treatment variation contributes little: \(e_g(1-e_g)\) is close to zero when almost everyone in the stratum receives the same treatment. Second, if the conditional contrasts vary, the common-slope coefficient need not equal an ordinary average over people or over strata. It is determined by the regression’s treatment variation within strata.
Worked Example: Unequal Stratum Proportions and Treatment Overlap
Suppose \(P(C=0)=0.8\) and \(P(C=1)=0.2\). The treatment probabilities are \(e_0=0.9\) and \(e_1=0.5\), and the conditional mean differences are \(\delta_0=2\) and \(\delta_1=8\). Find the common-slope adjusted coefficient.
The stratum weights before normalization are \(w_0=0.8(0.9)(0.1)=0.072\) and \(w_1=0.2(0.5)(0.5)=0.05\). Their sum is \(0.122\). Therefore \[ \beta=\frac{0.072(2)+0.05(8)}{0.122} =\frac{0.144+0.400}{0.122} =\frac{0.544}{0.122} =\frac{272}{61}\approx4.46. \] The population-proportion average of the two contrasts is \(0.8(2)+0.2(8)=3.2\), which is not the regression coefficient. The coefficient is larger because the less prevalent stratum has more treatment variation and a larger conditional contrast. The specified proportions correspond to 80% and 20% of the regression population; using equal numbers in the two strata would describe a different population and produce different weights.
Changing Adjustment Across Visits
At visit \(t\), a regression may adjust for a covariate history \(C_t\) available before \(A_t\). At another visit the analyst may use a different history, such as adding a newly measured \(L_t\). Even if both regressions use the same outcome scale, their treatment coefficients need not represent the same conditional comparison. The coefficient at each visit combines contrasts among the strata in its own adjustment set, with weights determined by that visit’s covariate distribution and treatment probabilities.
The following example isolates this weighting change. It assumes correctly specified conditional mean differences within the displayed strata; it does not assume that the strata at the two visits are the same people or that the coefficients are causal regime effects.
Worked Example: Identical Stratum Contrasts, Different Visit Coefficients
At visit 1, suppose the adjustment variable has two equally common strata, treatment probability \(0.5\) in both, and conditional contrasts 2 and 8. At visit 2, suppose the adjustment variable again has two strata, but their proportions are \(0.8\) and \(0.2\); the treatment probabilities are \(0.9\) and \(0.5\), and the conditional contrasts remain 2 and 8.
At visit 1, each stratum’s unnormalized weight is \(0.5(0.5)(0.5)=0.125\). Hence \[ \beta_1=\frac{0.125(2)+0.125(8)}{0.125+0.125} =\frac{1.25}{0.25}=5. \] At visit 2, the weights are \(0.8(0.9)(0.1)=0.072\) and \(0.2(0.5)(0.5)=0.05\), so \[ \beta_2=\frac{0.072(2)+0.05(8)}{0.072+0.05} =\frac{0.544}{0.122} =\frac{272}{61}\approx4.46. \] The conditional contrasts were held fixed, yet the regression coefficients differ because the covariate and treatment distributions differ. The change in coefficient alone is not evidence that the conditional treatment contrast changed over time.
A model that includes treatment-by-covariate interactions answers a different descriptive question: it allows the fitted treatment contrast to vary by stratum. For example, with a binary \(C\), the model \(E[Y\mid A,C]=\alpha+\gamma C+\beta A+\eta AC\) has fitted treatment contrast \(\beta\) in stratum \(C=0\) and \(\beta+\eta\) in stratum \(C=1\). This follows by subtracting the model’s fitted mean at \(A=0\) from its fitted mean at \(A=1\), separately in each stratum. The common-slope model instead constrains those two contrasts to be equal.
Adjustment Can Change the Conditional Comparison
The next example compares a regression that omits a covariate with one that adjusts for it. The calculations show why an adjusted coefficient need not be a simple refinement of an unadjusted coefficient: it can change both the composition of the comparison and the coefficient’s value. In longitudinal analyses, a newly included covariate may be a measured pre-treatment history at that visit. If it was itself affected by earlier treatment, conditioning on it does not, by itself, recover the total effect of a treatment history.
Worked Example: Adding a Covariate Changes the Coefficient
Let \(L\) be binary with \(P(L=0)=P(L=1)=0.5\). Let \(P(A=1\mid L=0)=0.2\) and \(P(A=1\mid L=1)=0.8\). Suppose the conditional outcome means are \(E[Y\mid A,L]=m_L+\delta_L A\), with \(m_0=0\), \(m_1=10\), \(\delta_0=2\), and \(\delta_1=8\).
With adjustment for \(L\), the weights are \(0.5(0.2)(0.8)=0.08\) and \(0.5(0.8)(0.2)=0.08\). Thus the common adjusted coefficient is \[ \beta_{\text{adjusted}}=\frac{0.08(2)+0.08(8)}{0.08+0.08} =\frac{0.80}{0.16}=5. \] Now omit \(L\) and fit a regression of \(Y\) on an intercept and \(A\) alone. The marginal treatment probability is \(E[A]=0.5\). The marginal outcome mean is \[ E[Y]=0.5\{0+0.2(2)\}+0.5\{10+0.8(8)\} =0.2+8.2=8.4. \] Further, \[ E[AY]=0.5\{0.2(2)\}+0.5\{0.8(18)\}=0.2+7.2=7.4. \] Therefore \(\operatorname{Cov}(A,Y)=7.4-(0.5)(8.4)=3.2\), while \(\operatorname{Var}(A)=0.5(0.5)=0.25\). The unadjusted slope is \(3.2/0.25=12.8\), far from the adjusted value of 5. The difference reflects the strong association of \(L\) with treatment and outcome as well as the different conditional contrasts; it is not a comparison of two coefficients with identical meanings.
For a causal interpretation of a conditional contrast, additional assumptions are required. In particular, treatment must be well-defined and consistently recorded; there must be no interference relevant to the estimand; treatment must be conditionally exchangeable with the potential outcomes given the measured pre-treatment history; and both treatment levels must have positive probability at histories in the target population. The conditional mean model must also represent the relevant contrasts adequately. These conditions do not make a coefficient from a visit-specific regression a total effect of an entire treatment history. They support an interpretation tied to the treatment decision and history being conditioned on.
Comparing Visit-Specific Analyses
Separate visit-specific regressions are easy to interpret when each has a clearly stated adjustment set and target population. However, their coefficients are directly comparable only with care. Check that the outcome scale, analytic population, covariate definitions, and model form are comparable. If the adjustment sets differ, state explicitly that the coefficients condition on different histories.
A pooled model can include visit indicators and treatment-by-visit interactions to estimate distinct visit-specific coefficients while holding a chosen adjustment strategy fixed. This helps separate differences associated with visit from differences caused by changing model specifications. It does not automatically solve misspecification or make the resulting coefficients causal. Another descriptive option is to estimate conditional contrasts and average them over an explicitly selected reference covariate distribution; the resulting standardized contrast targets that distribution rather than the regression’s implicit overlap weights.
These approaches answer different questions. A common-slope regression summarizes conditional contrasts with its own weights; an interaction model reports contrasts by stratum; and standardization averages contrasts using a specified reference distribution. None should be called “the treatment effect” without naming the scale, the conditioning history, and the population to which the statement refers.
Record which covariates are included and confirm that they precede the treatment decision being analyzed.
Identify strata with very few treated or untreated observations; their contrasts may be unstable and their contribution to a common slope may be small.
Decide whether a common treatment slope is plausible or whether treatment-by-covariate interactions are needed for the descriptive question.
When comparing visits, state whether the target is the fitted common slope, stratum-specific contrasts, or contrasts averaged over a common reference distribution.
Diagnostics and Common Pitfalls
- Calling a common slope a population-average effect. The theorem shows that its weights depend on both stratum prevalence and treatment variation. Use the population-proportion average only when that is the quantity actually calculated or targeted.
- Reading a coefficient change as effect change. First check whether the adjustment sets, covariate distributions, overlap, or analytic samples changed. Any of these can change the coefficient even if the conditional contrasts are constant.
- Ignoring weak overlap. If a stratum has \(e_g\) near 0 or 1, its weight \(p_g e_g(1-e_g)\) is small, and its contrast may be poorly estimated. Report the treatment counts or probabilities by stratum rather than relying only on the pooled coefficient.
- Assuming adjustment guarantees causality. A regression adjustment does not establish exchangeability, correct measurement, positivity, or a valid functional form. Conditioning on a covariate affected by prior treatment also changes what history is being compared.
- Comparing unlike models. Different outcome scales, samples, or interaction terms can produce coefficients with different interpretations. Align these choices or explain why they differ before interpreting a trend across visits.
Check Your Understanding
Answer each question, then check the solutions below.
- In the theorem, what happens to a stratum’s weight when its treatment probability approaches 1?
- Two visit-specific regressions have the same conditional contrasts but different treatment probabilities across strata. Must their common-slope coefficients agree? Explain.
- For \(P(C=0)=P(C=1)=0.5\), treatment probabilities \(0.5\) in both strata, and contrasts 1 and 5, calculate the common-slope coefficient.
- Name two checks needed before interpreting a regression coefficient as a causal conditional contrast.
Solutions. (1) Its weight \(p_g e_g(1-e_g)\) approaches zero, so it contributes little to the common slope. (2) No. The weights depend on within-stratum treatment variation as well as stratum prevalence, so changing treatment probabilities can change the coefficient. (3) The weights are both \(0.5(0.5)(0.5)=0.125\), giving \(\{0.125(1)+0.125(5)\}/0.25=3\). (4) Examples include conditional exchangeability given pre-treatment history, positivity, consistency, no relevant interference, and adequate model specification.