Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Contrasts for Biomarker Change

Mixed Models Review · Tutorial 82 of 697

Contrasts for Biomarker Change

Learn to define an interval-specific biomarker change as a fixed-effect contrast and quantify its uncertainty using the fitted coefficient covariance matrix.

Intermediate 10 min read

What You'll Learn

  • Express change between two times as a contrast of fixed-effect coefficients.
  • Construct contrast vectors for linear-time and categorical-time models.
  • Calculate a contrast standard error using the estimated fixed-effect covariance matrix.
  • Form and interpret a confidence interval using the appropriate degrees of freedom.
  • Distinguish within-group change from a difference in change between groups.
  • Recognize when the model does not support the requested contrast.

Why Express Change as a Contrast?

A fitted longitudinal mixed model can describe the mean biomarker trajectory over time while accounting for repeated measurements within a subject. A scientific question, however, is often about a particular interval: how much does the mean biomarker change from month 2 to month 8? Or is that change different between treatment groups? A model coefficient is not automatically the answer. The first task is to translate the question into a difference between fitted means.

That difference is a linear contrast of the model’s fixed-effect coefficients. Writing it explicitly makes clear which population-level quantity is being estimated and which coefficient uncertainties contribute to its standard error. The contrast can be used with a linear time trend, categorical visits, or other fixed-effect specifications, provided the model represents the requested times.

Definition: Let \(\boldsymbol{\beta}\) be the vector of fixed-effect coefficients in a fitted mixed model, and let \(\mathbf{c}\) be a specified vector of constants. The linear contrast is \(L=\mathbf{c}^{T}\boldsymbol{\beta}\). Its estimate is \(\hat L=\mathbf{c}^{T}\hat{\boldsymbol{\beta}}\). If the estimated covariance matrix of the fixed-effect estimates is \(\widehat{\mathrm{Var}}(\hat{\boldsymbol{\beta}})\), then $$ \widehat{\mathrm{Var}}(\hat L)=\mathbf{c}^{T}\widehat{\mathrm{Var}}(\hat{\boldsymbol{\beta}})\mathbf{c}, \qquad SE(\hat L)=\sqrt{\mathbf{c}^{T}\widehat{\mathrm{Var}}(\hat{\boldsymbol{\beta}})\mathbf{c}}. $$

From a Time Interval to a Contrast

Suppose the model’s fixed-effects part gives the population-average mean biomarker at time \(t\) as \(\mu(t)=\mathbf{x}(t)^T\boldsymbol{\beta}\), where \(\mathbf{x}(t)\) is the fixed-effect design vector at that time. The model-implied mean change from \(t_1\) to \(t_2\) is

$$ \Delta(t_1,t_2)=\mu(t_2)-\mu(t_1) =\left\{\mathbf{x}(t_2)-\mathbf{x}(t_1)\right\}^{T}\boldsymbol{\beta}. $$

Thus the contrast vector is \(\mathbf{c}=\mathbf{x}(t_2)-\mathbf{x}(t_1)\). The estimated change is the difference between the two fitted population-average means, and its standard error follows from the covariance matrix of the fixed-effect estimates. The covariance terms matter: uncertainty in two fitted means cannot generally be treated as independent.

For example, with a linear time effect and fixed-effects mean \(\mu(t)=\beta_0+\beta_1t\), the change over an interval of length \(d=t_2-t_1\) is \(d\beta_1\). The intercept cancels. If time is represented by visit indicators instead, the contrast is assembled from the coefficients that define the two visit means. The model’s parameterization determines the vector; the scientific question determines the difference.

Assumptions for the usual interval: The fixed-effects mean model must represent the requested times and the contrast must be estimable from the fitted design. The fitted model’s covariance estimate must be suitable for the repeated-measure structure and its assumptions. For a \(t\)-based confidence interval, use the degrees of freedom supplied by the fixed-effect inference method; the interval relies on the corresponding approximate sampling distribution for the contrast. These conditions do not require the random effects of a particular subject to be known: this contrast concerns the fixed-effects, population-average mean.

Standard Error and Confidence Interval

Let \(\widehat{\mathbf{V}}=\widehat{\mathrm{Var}}(\hat{\boldsymbol{\beta}})\). Expanding the quadratic form shows how each coefficient variance and covariance contributes:

$$ \widehat{\mathrm{Var}}(\hat L) =\sum_{j=1}^{p}\sum_{k=1}^{p}c_jc_k\widehat{\mathrm{Cov}}(\hat\beta_j,\hat\beta_k). $$

The diagonal terms are coefficient variances. Off-diagonal terms are covariances; their contributions can increase or decrease the contrast variance depending on their signs and the contrast weights. A \(100(1-\alpha)\%\) confidence interval is

$$ \hat L \ \pm\ t_{1-\alpha/2,df}\,SE(\hat L), $$

where \(df\) is the degrees of freedom used for that fixed-effect contrast. In repeated-measures models, this may be an approximate degrees of freedom rather than a simple residual count. The interval estimates a change in the biomarker’s units. Its frequentist interpretation is that the procedure would cover the true model-defined contrast in \(100(1-\alpha)\%\) of repeated samples under the model and inference assumptions.

Worked Example: Change Over Six Months With Linear Time

Suppose a hypothetical mixed model for a biomarker measured in milligrams per liter has fixed-effects mean \(\mu(t)=\beta_0+\beta_1t\), where time \(t\) is measured in months. The fitted coefficients are \(\hat\beta_0=8.20\) mg/L and \(\hat\beta_1=-0.180\) mg/L per month. The estimated fixed-effect covariance matrix, in the coefficient order \((\hat\beta_0,\hat\beta_1)\), is

$$ \widehat{\mathbf{V}}= \begin{pmatrix} 0.1600 & -0.0060\\ -0.0060 & 0.0025 \end{pmatrix}. $$

Find the model-implied mean change from month 2 to month 8. The interval length is \(8-2=6\) months. Since the intercept cancels, the contrast vector is \(\mathbf{c}=(0,6)^T\), and

$$ \hat L=0\hat\beta_0+6\hat\beta_1 =6(-0.180)=-1.080\text{ mg/L}. $$

The standard error is calculated from the covariance matrix:

$$ SE(\hat L) =\sqrt{(0,6) \begin{pmatrix} 0.1600 & -0.0060\\ -0.0060 & 0.0025 \end{pmatrix} \begin{pmatrix}0\\6\end{pmatrix}} =\sqrt{36(0.0025)} =\sqrt{0.0900} =0.3000\text{ mg/L}. $$

Suppose the contrast has \(df=24\), so the 95% critical value is approximately \(t_{0.975,24}=2.064\). The interval is

$$ -1.080\pm 2.064(0.3000) =-1.080\pm0.6192 =(-1.699,\,-0.4608)\text{ mg/L}. $$

Under this model, the estimated population-average biomarker decreases by 1.080 mg/L from month 2 to month 8. The 95% confidence interval is compatible with decreases between about 0.461 and 1.699 mg/L. The negative endpoints indicate a decrease throughout this interval.

Contrasts With Categorical Visit Times

A linear-time model assumes the same mean rate of change throughout the modeled period. If the fixed-effects model instead assigns a separate mean to each visit, a change between two visits is the difference of their corresponding means. The contrast is still linear, but its coefficients may involve multiple estimated means. As before, use the full covariance matrix: the uncertainty in a difference depends on the covariance between the estimated means.

Worked Example: Change Between Two Visit Means

In a hypothetical model, the fixed-effects vector consists of the population-average biomarker means at baseline, month 3, and month 9, in that order. Their estimates are \(\hat{\boldsymbol{\beta}}=(5.80,6.40,7.10)^T\) mg/L. Suppose the estimated covariance matrix is

$$ \widehat{\mathbf{V}}= \begin{pmatrix} 0.0400 & 0.0150 & 0.0100\\ 0.0150 & 0.0625 & 0.0150\\ 0.0100 & 0.0150 & 0.0900 \end{pmatrix}. $$

The requested change from month 3 to month 9 is \(\mu_9-\mu_3\), so \(\mathbf{c}=(0,-1,1)^T\). Its estimate is \(7.10-6.40=0.7000\) mg/L. The variance and standard error are

$$ \widehat{\mathrm{Var}}(\hat L) =0.0625+0.0900-2(0.0150) =0.1225, \qquad SE(\hat L)=\sqrt{0.1225}=0.3500\text{ mg/L}. $$

Suppose \(df=30\), giving \(t_{0.975,30}=2.042\). The 95% interval is

$$ 0.7000\pm2.042(0.3500) =0.7000\pm0.7147 =(-0.0147,\,1.415)\text{ mg/L}. $$

The estimated population-average biomarker is 0.7000 mg/L higher at month 9 than at month 3. Because the interval includes zero, these data do not establish a nonzero change at the two-sided 5% level using this model and approximation. This does not prove that the true change is zero.

Comparing Change Between Groups

A difference in change is a contrast of two interval changes. It is not the same quantity as the difference between groups at one particular time. For a model with a linear time effect and a treatment-by-time interaction, let the fixed-effects vector be \((\beta_0,\beta_1,\beta_2,\beta_3)^T\), with population-average mean \(\beta_0+\beta_1t+\beta_2G+\beta_3Gt\), where \(G=0\) denotes the reference group and \(G=1\) denotes the other group. The reference-group change over length \(d\) is \(d\beta_1\); the other-group change is \(d(\beta_1+\beta_3)\). Subtracting the first change from the second gives \(d\beta_3\).

Worked Example: Difference in Four-Month Change

Suppose a hypothetical fitted mixed model uses the group coding above, with time in months and biomarker in units per liter. The estimated treatment-by-time coefficient is \(\hat\beta_3=0.120\) units per liter per month, and its estimated variance is \(0.002025\). The question is whether the groups differ in their population-average change from month 1 to month 5. The interval length is 4 months, so the contrast vector is \(\mathbf{c}=(0,0,0,4)^T\). Therefore,

$$ \hat L=4\hat\beta_3=4(0.120)=0.4800\text{ units/L}, \qquad SE(\hat L)=\sqrt{4^2(0.002025)} =\sqrt{0.03240} =0.1800\text{ units/L}. $$

Suppose the contrast has \(df=40\), with \(t_{0.975,40}=2.021\). Then

$$ 0.4800\pm2.021(0.1800) =0.4800\pm0.3638 =(0.1162,\,0.8438)\text{ units/L}. $$

The estimated change in the \(G=1\) group exceeds the change in the reference group by 0.4800 units/L over these four months. The 95% interval is above zero, supporting a positive difference in change at the two-sided 5% level under the stated model and inference method. This is a contrast between group changes, not a claim that treatment caused the difference.

Derivation and Practical Checks

The variance formula follows directly from the variance rule for a linear combination. For a fixed vector \(\mathbf{c}\), the estimated contrast is \(\hat L=\mathbf{c}^T\hat{\boldsymbol{\beta}}\). Subtracting its expectation and taking variance gives

$$ \mathrm{Var}(\hat L) =\mathrm{Var}\!\left(\mathbf{c}^T\hat{\boldsymbol{\beta}}\right) =\mathbf{c}^T\mathrm{Var}(\hat{\boldsymbol{\beta}})\mathbf{c}. $$

Replacing the unknown covariance matrix with its fitted estimate yields the estimated contrast variance. For a difference between two estimated means, this is the familiar rule \(\widehat{\mathrm{Var}}(\hat\mu_2-\hat\mu_1)=\widehat{\mathrm{Var}}(\hat\mu_2)+\widehat{\mathrm{Var}}(\hat\mu_1)-2\widehat{\mathrm{Cov}}(\hat\mu_1,\hat\mu_2)\). The minus sign in front of twice the covariance comes from multiplying the two contrast weights, \(1\) and \(-1\).

Before reporting an interval, check that the contrast matches the question and the coefficient order used in the fitted model. Also verify that its units are appropriate: a change has the biomarker’s units, while a slope has biomarker units per time unit. For a linear-time model, a \(d\)-month change multiplies a per-month slope by \(d\); changing the time scale changes the numerical slope but not the correctly computed interval change.

A contrast also requires the relevant fixed-effect combination to be estimable. If the fitted design does not provide information to distinguish the requested means or effects, a numerical answer may be unavailable or unstable. Extrapolating far beyond observed times is especially dependent on the assumed mean trajectory. A narrow interval does not remedy a poor model for the mean or covariance. Inspect whether the modeled time pattern and covariance structure are plausible before relying on the contrast; detailed model diagnostics require separate consideration.

Common Mistakes and Alternatives

  • Using a slope as though it were an interval change. A slope has units per time unit. Multiply by the interval length when the model is linear in time; for categorical visits, contrast the two visit means directly.
  • Ignoring covariance between estimated means. The variance of a difference includes the covariance term. Treating the two estimates as independent can give the wrong standard error.
  • Confusing a group difference at one time with a difference in change. A baseline group contrast and a treatment-by-time contrast answer different questions. Define each group’s change first, then subtract them if the target is a difference in change.
  • Interpreting the contrast as subject-specific. A fixed-effect contrast describes a model-implied population-average mean difference. It is not the predicted change for a particular subject’s random effects.
  • Assuming a confidence interval gives the probability the parameter is inside it. The 95% level describes the long-run coverage of the interval procedure under its assumptions, not a probability assigned to this fixed parameter after observing the data.

A contrast is often clearer than comparing separate confidence intervals for two fitted means: overlap or non-overlap of those intervals is not a direct confidence interval for their difference. A contrast directly estimates the target and accounts for covariance. Alternatively, reporting the fitted means at both times can help describe the trajectory, but the estimated difference and its uncertainty should be calculated as a contrast when the inferential question concerns change.

Contrasts remain limited by the fitted model. A straight-line trend yields the same change per unit time everywhere, so it cannot represent a changing rate unless the fixed-effects mean allows that pattern. A visit-specific model avoids imposing a constant rate between visits but does not by itself estimate an unobserved intermediate mean without additional modeling assumptions. In either case, state the time interval, population, biomarker units, and model basis for the reported change.

Check Your Understanding

Use the fitted model and the stated covariance information in each question. Solutions follow the questions.

  1. A linear-time model estimates a slope of \(-0.25\) mg/L per month. What is the estimated change over 8 months?
  2. For a difference between two visit means, their estimated variances are 0.09 and 0.16, and their estimated covariance is 0.03. Find the contrast variance and standard error.
  3. A group-by-time coefficient is 0.08 units per month. What contrast represents the difference in group changes over a 5-month interval?
  4. Why is the covariance between two estimated visit means needed when calculating the uncertainty of their difference?

Solutions. (1) The change is \(8(-0.25)=-2.00\) mg/L. (2) For \(\hat\mu_2-\hat\mu_1\), the variance is \(0.16+0.09-2(0.03)=0.19\), so \(SE=\sqrt{0.19}=0.4359\) in the biomarker’s units. (3) The contrast is \(5\beta_{\text{group}\times\text{time}}\), with estimate \(5(0.08)=0.400\) units over five months; its standard error requires the estimated variance of that interaction coefficient. (4) The two estimates are generally correlated because they come from the same fitted model and repeated-measure data. The variance of their difference includes minus twice their covariance.

Clinical Biostats