Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Block Covariance Structures for Marker Random Effects

Multiple Longitudinal Markers · Tutorial 369 of 697

Block Covariance Structures for Marker Random Effects

You will learn to construct a joint random-effects covariance matrix and interpret how its blocks describe dependence between marker trajectories within an individual.

Advanced 11 min read

What You'll Learn

  • Assemble a block covariance matrix for multiple markers with random intercepts and slopes.
  • Interpret within-marker and cross-marker covariances in terms of units and time.
  • Derive the random-effects contribution to covariance between two marker measurements.
  • Compare unstructured and block-diagonal covariance specifications.
  • Recognize positive-semidefiniteness, identifiability, and fitting diagnostics.

Why the Random-Effects Blocks Matter

For multiple longitudinal markers, each individual can have a marker-specific trajectory that differs from the population mean. A random intercept represents an individual’s deviation in marker level, and a random slope represents an individual’s deviation in rate of change. When several markers are measured on the same individual, these deviations may be related: an individual whose first marker is unusually high may also tend to have an unusually high second marker, or the individual’s slope for one marker may be associated with the other marker’s intercept.

A block covariance matrix expresses these relationships directly. Its diagonal blocks describe variation and intercept–slope association within each marker. Its off-diagonal blocks describe association between random effects for different markers. This is a subject-level covariance structure: it is distinct from covariance among measurement errors recorded at the same visit.

Definition: For individual \(i\) and marker \(k\), let \(b_{ik}=(b_{ik0},b_{ik1})^\mathsf{T}\) be the random intercept and random slope. Stack the random effects in marker order as \(b_i=(b_{i1}^\mathsf{T},\ldots,b_{iK}^\mathsf{T})^\mathsf{T}\). A block covariance model specifies \(E(b_i)=0\) and \(\operatorname{Var}(b_i)=D\), where \(D\) is partitioned into \(2\times2\) blocks \(D_{k\ell}=\operatorname{Cov}(b_{ik},b_{i\ell})\). The diagonal block \(D_{kk}\) is symmetric; in general, \(D_{\ell k}=D_{k\ell}^\mathsf{T}\).

For two markers, using the ordering \((b_{i10},b_{i11},b_{i20},b_{i21})\), the matrix is

$$ D= \begin{pmatrix} D_{11} & D_{12}\\ D_{12}^{\mathsf T} & D_{22} \end{pmatrix}. $$

Each diagonal block contains the variance of the marker’s random intercept, the variance of its random slope, and their covariance. The off-diagonal block \(D_{12}\) contains four covariances: marker 1 intercept with marker 2 intercept, marker 1 intercept with marker 2 slope, marker 1 slope with marker 2 intercept, and marker 1 slope with marker 2 slope. These quantities need not be equal to their transposed counterparts in the same block, because \(D_{12}\) is not generally symmetric.

From Random Effects to Covariance Between Measurements

Write the random-effects part of marker \(k\)’s trajectory at time \(t\) as \(z(t)^\mathsf{T}b_{ik}\), where \(z(t)=(1,t)^\mathsf{T}\). A typical longitudinal model also includes a population mean and a measurement error:

$$ Y_{ik}(t)=x_{ik}(t)^\mathsf{T}\beta_k+z(t)^\mathsf{T}b_{ik}+\varepsilon_{ik}(t). $$

Here \(x_{ik}(t)^\mathsf{T}\beta_k\) describes the mean trajectory. The covariance calculation below concerns the random-effects contribution only. For markers \(k\) and \(\ell\), at times \(t\) and \(s\), its covariance is

$$ \operatorname{Cov}\{z(t)^\mathsf{T}b_{ik},z(s)^\mathsf{T}b_{i\ell}\} =z(t)^\mathsf{T}D_{k\ell}z(s). $$

This follows because the fixed mean terms are nonrandom and the covariance matrix of \((b_{ik}^\mathsf{T},b_{i\ell}^\mathsf{T})^\mathsf{T}\) contains \(D_{k\ell}\) as its cross block. For two random intercepts and slopes, write \(D_{k\ell}=\begin{pmatrix}d_{00}&d_{01}\\d_{10}&d_{11}\end{pmatrix}\). Expanding the product gives

$$ z(t)^\mathsf{T}D_{k\ell}z(s) =d_{00}+d_{01}s+d_{10}t+d_{11}ts. $$

The time arguments matter. For example, a cross-marker covariance can be positive at baseline but smaller or negative later if the intercept–slope or slope–slope terms offset the intercept covariance. The units also matter: an intercept variance has units of marker squared, while a slope variance has units of marker squared per time squared. Centering time changes the interpretation of the intercept and changes the numerical covariance entries, although it does not change the underlying fitted trajectories when the model is reparameterized consistently.

Worked Example: Calculating Cross-Marker Covariance at Two Times

Suppose time is measured in years from baseline, and a hypothetical fitted random-effects covariance matrix for two markers is

$$ D= \begin{pmatrix} 0.64&0.08&0.12&0.02\\ 0.08&0.09&0.003&0.01\\ 0.12&0.003&0.49&-0.035\\ 0.02&0.01&-0.035&0.0625 \end{pmatrix}. $$

The cross-marker block is \(D_{12}=\begin{pmatrix}0.12&0.02\\0.003&-0.035\end{pmatrix}\). Calculate the random-effects covariance between marker 1 at year 2 and marker 2 at year 1.

Using \(z(2)=(1,2)^\mathsf{T}\) and \(z(1)=(1,1)^\mathsf{T}\),

$$ \begin{aligned} \operatorname{Cov}_{b}\{Y_{i1}(2),Y_{i2}(1)\} &=z(2)^\mathsf{T}D_{12}z(1)\\ &=0.12+(0.02)(1)+(0.003)(2)+(-0.035)(2)(1)\\ &=0.12+0.02+0.006-0.07\\ &=0.076. \end{aligned} $$

Thus the random-effects contribution to covariance is \(0.076\) in the product of the two markers’ measurement units. This is not automatically the total covariance of the observed measurements: any covariance contributed by the measurement errors is a separate component.

Validity and Common Covariance Structures

A covariance matrix must be symmetric and positive semidefinite: for every vector \(a\), \(a^\mathsf{T}Da\geq 0\). This condition ensures that no linear combination of the random effects has negative variance. It also constrains the off-diagonal blocks; they cannot be chosen independently of the diagonal blocks without regard to validity. In practice, estimation procedures parameterize or constrain \(D\) so the fitted matrix satisfies this requirement.

An unstructured covariance matrix estimates all distinct entries subject to symmetry and positive semidefiniteness. A block-diagonal structure instead sets every cross-marker block to zero, asserting that the markers’ random effects are uncorrelated within individuals. A block-diagonal assumption is a modeling restriction, not a consequence of using marker-specific random effects.

Worked Example: Counting Covariance Parameters

Suppose there are three markers, each with a random intercept and slope. An unstructured covariance matrix has dimension \(6\times6\). Because it is symmetric, it has

$$ \frac{6(6+1)}{2}=21 $$

distinct covariance parameters: six variances and fifteen covariances. If the model is block diagonal, it has three separate \(2\times2\) symmetric diagonal blocks, each with three parameters, for a total of \(3(3)=9\). The restriction therefore sets \(21-9=12\) cross-marker covariances to zero.

More generally, with \(K\) markers and \(q\) random effects per marker, an unstructured matrix has \(Kq(Kq+1)/2\) parameters, whereas a block-diagonal matrix has \(Kq(q+1)/2\). The difference is \(K(K-1)q^2/2\). This can be substantial: a flexible matrix captures more possible dependence but requires more information to estimate reliably.

Intermediate structures are possible. For example, a model may retain cross-marker intercept covariances while constraining some cross-marker slope covariances, or impose a parsimonious parameterization across markers. Such restrictions should be justified by the scientific question and the available data, rather than selected solely because they produce a convenient fit.

Worked Example: Interpreting the Entries of a Block

Use the two-marker matrix in the first worked example. Marker 1’s random intercept standard deviation is \(\sqrt{0.64}=0.8\) marker units, and its random slope standard deviation is \(\sqrt{0.09}=0.3\) marker units per year. Marker 2’s corresponding standard deviations are \(\sqrt{0.49}=0.7\) marker units and \(\sqrt{0.0625}=0.25\) marker units per year.

The intercept covariance is \(0.12\), so the correlation between the two random intercepts is

$$ \frac{0.12}{(0.8)(0.7)}=0.2143. $$

The slope covariance is \(-0.035\), giving a slope correlation of

$$ \frac{-0.035}{(0.3)(0.25)}=-0.4667. $$

In this hypothetical model, individuals with higher-than-average marker 1 intercepts tend, on average, to have higher marker 2 intercepts, while higher marker 1 slopes tend to accompany lower marker 2 slopes. These are associations among subject-specific deviations, not causal effects. The off-diagonal entry \(0.02\), for example, is the covariance between marker 1’s intercept and marker 2’s slope; its interpretation must retain the different units of those quantities.

Assumptions, Diagnostics, and Limitations

A standard Gaussian random-effects specification assumes that \(b_i\) has a mean-zero multivariate normal distribution with covariance \(D\), and that different individuals’ random-effects vectors are independent, conditional on modeled covariates. The covariance calculations themselves require finite second moments and the stated covariance structure; normality is an additional distributional assumption often used for likelihood-based fitting. The choice of random-effects design, such as an intercept and a linear slope for each marker, is also part of the model.

A useful check is to inspect the estimated diagonal variances, correlations, and eigenvalues of \(D\). A variance estimated at or near zero, a correlation near \(1\) or \(-1\), or a nearly singular matrix can indicate that the data do not support the requested flexibility. Such results may also arise from weakly informative time patterns, too few individuals, limited overlap in measurement schedules, or a poorly scaled time variable. A convergence message alone does not establish that each covariance parameter is well identified.

When diagnosing a fit, compare estimates under scientifically defensible structures and check whether conclusions are sensitive to those restrictions. Examine standard errors and uncertainty intervals for covariance parameters, not only point estimates. If an unstructured matrix is unstable, a more parsimonious structure may be appropriate, but it changes the assumptions and may affect uncertainty in trajectory estimates. Conversely, setting cross-marker blocks to zero simply to avoid a difficult fit can conceal meaningful within-individual dependence.

The random-effects covariance is not a substitute for a suitable model of measurement error. It captures dependence induced by shared subject-level trajectories; residual covariance describes additional dependence among observations after those trajectories are accounted for. These are distinct sources of covariance. The present structure also does not, by itself, specify how marker histories relate to a time-to-event outcome; that requires a separate survival-model component.

Common Mistake

A frequent error is to read \(D_{12}\) as a correlation matrix and interpret \(0.12\) as a correlation of 0.12. It is a covariance, with units equal to the product of the associated random effects’ units. To obtain a correlation, divide that covariance by the product of the two standard deviations. Another error is to assume that a positive intercept covariance guarantees positive covariance between the markers at every time. The time-dependent expression \(d_{00}+d_{01}s+d_{10}t+d_{11}ts\) shows why that need not hold.

Key takeaway: The diagonal blocks of \(D\) describe each marker’s random trajectory; the off-diagonal blocks describe how different markers’ random trajectories co-vary within individuals. Interpret each entry with its units, time reference, and covariance-matrix constraints in view.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. For two markers with random intercepts and slopes, what does the entry in row 1, column 4 of \(D\), using the ordering \((b_{i10},b_{i11},b_{i20},b_{i21})\), represent?
  2. If \(D_{12}=\begin{pmatrix}0.10&0\\0&0\end{pmatrix}\), what is the random-effects covariance between marker 1 at time \(t\) and marker 2 at time \(s\)?
  3. With four markers and two random effects per marker, how many covariance parameters are in an unstructured matrix?
  4. Why does an estimated random-slope correlation near \(-1\) warrant investigation?

Solutions. (1) It is \(\operatorname{Cov}(b_{i10},b_{i21})\), the covariance between marker 1’s random intercept and marker 2’s random slope. (2) The formula is \(z(t)^\mathsf{T}D_{12}z(s)=0.10\), so this particular random-effects covariance is constant over the two time arguments. (3) There are \(4(2)=8\) random effects, giving \(8(9)/2=36\) distinct entries in a symmetric unstructured covariance matrix. (4) A correlation near \(-1\) can signal a nearly singular covariance estimate or weak identification of the intercept–slope variation; inspect the variance estimates, uncertainty, time design, scaling, and fit stability before interpreting it substantively.

Clinical Biostats