Why Compare Treatment-Specific Trends?
A biomarker can change over time in both treatment groups while changing at different rates in each. A model with a treatment main effect alone allows groups to start at different average levels but gives them a common time trend. To ask whether their average rates of change differ, the model must include a treatment-by-time interaction. The comparison in this tutorial is between these common-slope and treatment-specific-slope models.
The focus is on a linear time trend over the period being analyzed. Time may be recorded at irregular visit times; equal numbers or spacing of measurements are not required by the model. The trend is nevertheless an approximation whose suitability should be assessed for the particular follow-up period.
Model and Assumptions
For a two-group comparison, let \(Y_{ij}\) be the biomarker for subject \(i\) at visit \(j\), \(t_{ij}\) be time in years since baseline, and \(G_i=1\) for the treatment group and \(G_i=0\) for the control group. A linear mixed model with treatment-specific trends is
Here \(\beta_0\) is the population mean at baseline for the control group, \(\beta_2\) is the baseline difference between treatment and control, \(\beta_1\) is the control-group mean change per year, and \(\beta_3\) is the treatment-minus-control difference in mean change per year. Thus the treatment-group slope is \(\beta_1+\beta_3\). The subject-specific random intercept and slope are \(b_{0i}\) and \(b_{1i}\); they allow subjects to vary around the group-level trajectories.
A standard likelihood comparison assumes the outcome distribution and covariance model are correctly specified. For example, conditional on the random effects, residuals may be modeled as independent normal errors with mean zero and variance \(\sigma^2\); subject-level random effects are commonly modeled as independent draws from a mean-zero multivariate normal distribution with covariance matrix \(D\). Subjects must be independent of one another. The fixed-effects mean structure should be adequate over the chosen time range, and the residual and random-effects structures should represent the dependence and variability sufficiently well.
The treatment groups and time variable must be defined consistently in both candidate models. For a likelihood-ratio comparison of fixed effects, fit both models by maximum likelihood (ML), using the same observed biomarker records and the same random-effects and residual covariance structures. Restricted maximum likelihood (REML) likelihoods are not directly comparable when the fixed-effects structures differ. A missing measurement is not by itself a reason to discard a subject, but likelihood-based inference relies on an appropriate missingness assumption, typically missing at random conditional on observed data and the model. It does not automatically correct for dropout that depends on unobserved biomarker values.
What the Model Comparison Tests
The common-slope model removes the treatment-by-time term while retaining the treatment main effect. The resulting nested models test \(H_0:\beta_3=0\) against \(H_a:\beta_3\ne 0\). Under the null, the two groups may have different baseline means but share a population-average slope. Under the alternative, their slopes differ.
If \(\ell_0\) and \(\ell_1\) are the maximized ML log-likelihoods under the common-slope and treatment-specific-slope models, respectively, the likelihood-ratio statistic is
For nested models under the null and standard regularity conditions, \(\Lambda\) has an approximate chi-square distribution with degrees of freedom equal to the difference in the number of fixed-effect parameters. Here one interaction coefficient is added, so \(df=1\). This is a test of the fixed interaction, not a test that a variance component equals zero. The latter has different boundary issues.
AIC offers a related but different comparison. For a fitted model with \(k\) estimated parameters and maximized log-likelihood \(\ell\), \(AIC=2k-2\ell\); smaller AIC indicates a better trade-off between likelihood fit and parameter count among the candidate models. AIC is not a p-value and does not test a null hypothesis. The Bayesian information criterion, \(BIC=k\log(n)-2\ell\), applies a different complexity penalty; the definition of \(n\) for clustered data should follow the modeling software’s convention and be reported. Neither criterion establishes that a selected model is an adequate description of the data.
Worked Example: Testing Whether Two Groups Have Different Slopes
Suppose a hypothetical study measures a biomarker in concentration units over three years. In a treatment-specific-slope model, the estimated control slope is \(0.12\) concentration units per year, and the treatment-by-time coefficient is \(0.18\) concentration units per year with \(SE=0.075\). The estimated treatment slope is therefore \(0.12+0.18=0.30\) concentration units per year. Assume the fixed-effect test uses \(df=46\), based on the chosen degrees-of-freedom method.
The estimated treatment-minus-control slope difference is \(0.18\) concentration units per year. The test statistic for \(H_0:\beta_3=0\) is
For a two-sided test with 46 degrees of freedom, the p-value is approximately \(0.020\). At significance level \(\alpha=0.05\), the data provide evidence that the population-average linear trends differ between groups. This does not establish that treatment caused the difference; a causal interpretation also depends on the study design and assumptions about confounding.
Using \(t_{0.975,46}\approx2.013\), a 95% confidence interval for the slope difference is
The interval describes plausible values for the treatment-minus-control population-average slope difference under the model. It is not a 95% probability statement about this fixed parameter. The positive interval indicates a greater estimated increase per year in the treatment group over the modeled period.
Likelihood Comparison and Information Criteria
The likelihood-ratio test compares how much better the larger model fits before penalizing it; its reference distribution accounts for the added parameters under the null. AIC instead subtracts a fixed penalty of two units for each estimated parameter. These approaches can agree, but they answer different questions. The likelihood-ratio test evaluates a specified nested null, whereas AIC ranks candidate models by a penalized fit criterion.
Worked Example: Comparing Common and Treatment-Specific Slopes
Consider hypothetical ML fits to the same 120 subjects’ available biomarker records, with the same random-intercept/random-slope and residual structure in both models. The common-slope model has log-likelihood \(\ell_0=-416.1\) and \(k_0=5\) estimated parameters. The treatment-specific-slope model has \(\ell_1=-412.6\) and \(k_1=6\). The one additional parameter is the treatment-by-time coefficient.
The likelihood-ratio statistic is
With one added fixed-effect parameter, the null reference distribution is approximately \(\chi^2_1\), giving \(p\approx0.00815\). At \(\alpha=0.05\), the result supports allowing different group slopes, provided the nesting, ML fitting, and model assumptions are appropriate.
The AIC values are
The treatment-specific model has AIC lower by \(842.2-837.2=5.0\), so it is preferred by AIC among these two candidates. This is consistent with, but is not the same conclusion as, the likelihood-ratio test. The comparison is meaningful because both likelihoods use the same records and covariance structure and are ML likelihoods.
Contrasts for More Than Two Groups
With several treatment groups, coefficients depend on the chosen reference group, but any scientifically relevant difference in slopes can be written as a linear contrast. If the fixed-effect estimate vector is \(\hat{\boldsymbol{\beta}}\), its estimated covariance matrix is \(V\), and the contrast is specified by vector \(\mathbf{c}\), then the estimated contrast is \(\mathbf{c}^{\mathsf T}\hat{\boldsymbol{\beta}}\), with standard error
For a two-group model, the treatment-minus-control slope contrast is simply \(\beta_3\). For three groups with control as the reference, if \(\beta_3\) and \(\beta_4\) are the two treatment-by-time coefficients, the difference between the two treatment slopes is \(\beta_3-\beta_4\). A joint test that all group slopes are equal is an omnibus test of all treatment-by-time coefficients together; a particular contrast answers a more focused question. If many contrasts are examined, the analysis should account for multiplicity or clearly identify which contrasts were prespecified.
Worked Example: Comparing Two Active-Treatment Slopes
In a hypothetical three-group study, let control be the reference group. Estimated slopes are \(0.10\) concentration units per year for control, \(0.30\) for Treatment A, and \(0.15\) for Treatment B. Thus the interaction estimates are \(\hat\beta_3=0.20\) for A versus control and \(\hat\beta_4=0.05\) for B versus control. Suppose their estimated variances are \(0.0064\) and \(0.0049\), and their covariance is \(0.0020\).
The estimated Treatment A minus Treatment B slope difference is
Its variance and standard error are
Using a hypothetical \(df=60\), the test statistic is \(t=0.15/0.08544=1.755\). The two-sided p-value is approximately \(0.084\), so at the 0.05 level this contrast does not provide sufficient evidence that the two active-treatment slopes differ. A 95% interval using \(t_{0.975,60}\approx2.000\) is
Because the interval includes zero, it is consistent with the test result. The estimated difference is positive, but its uncertainty is substantial enough that the data do not distinguish the two slopes at this level.
Diagnostics, Alternatives, and Limitations
A statistically significant interaction is useful only if the model provides a credible account of the observed longitudinal data. Before interpreting it, check whether the linear trend is reasonable across the follow-up period, whether residuals show systematic patterns or changing variability, and whether the random-effects and residual covariance assumptions are plausible. The earlier material on residual diagnostics, subject-level influence, singular fits, and unequal follow-up provides relevant checks. In this comparison, the two candidate models should use the same defensible covariance structure so the trend term is the main change being assessed.
A highly influential subject or a weakly identified random-slope variance can make fixed-effect estimates and their uncertainty unstable. A likelihood comparison can also be misleading if the models were fitted to different records, use different likelihood definitions, or differ in several structural choices at once. If the treatment-specific model fits poorly in a graphical or residual assessment, a lower AIC or small p-value does not repair that lack of fit.
The main alternatives have distinct purposes. A fixed-effect contrast directly estimates a slope difference and gives its uncertainty in interpretable units. A likelihood-ratio test assesses whether adding the interaction improves fit relative to a specified nested model. AIC or BIC ranks a set of candidate models with different complexity penalties. Separate models fitted independently by group may describe group trends, but they do not directly provide the pooled covariance-based test of a between-group slope difference. None of these tools, by itself, resolves nonlinearity, informative dropout, confounding, or a poorly specified covariance structure.
Interpret the slope difference in the biomarker’s units per unit time and over the period studied. With observational treatment allocation, describe it as an adjusted association unless the design and assumptions justify a causal claim. With randomized treatment, the interaction can support a treatment-effect interpretation only under the additional assumptions required by the study and missing-data process.
Check Your Understanding
Use the model and comparison principles above. Solutions are included for checking your reasoning.
- If the control slope is \(0.08\) units per month and the treatment-by-time estimate is \(-0.03\) units per month, what is the treatment slope and what does the interaction estimate represent?
- A common-slope model has \(\ell_0=-250.0\), and a nested interaction model has \(\ell_1=-247.9\), adding one fixed-effect parameter. Calculate the likelihood-ratio statistic and state the approximate reference distribution under the null.
- Why must the fixed-effect models in a likelihood-ratio comparison use ML rather than directly comparing their REML likelihoods?
- A slope-difference estimate is \(0.12\) units per year with \(SE=0.10\). Calculate its Wald statistic and explain why the estimate alone does not establish a difference.
Solutions. (1) The treatment slope is \(0.08+(-0.03)=0.05\) units per month. The interaction is the treatment-minus-control slope difference, so the treatment trend is 0.03 units per month lower. (2) \(\Lambda=2[-247.9-(-250.0)]=2(2.1)=4.2\); under the null it is approximately \(\chi^2_1\). (3) REML likelihoods depend on the fixed-effects design, so their values are not directly comparable when that design changes; ML provides likelihoods on a common basis for this fixed-effect comparison. (4) \(t=0.12/0.10=1.20\). The estimate is positive, but its uncertainty is large relative to its size; without a sufficiently small p-value or interval excluding zero, it does not establish a slope difference.