Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Shared Random Effects For Visits And Biomarkers

Informative Observation Schedules · Tutorial 43 of 697

Shared Random Effects For Visits And Biomarkers

See how a shared latent effect can connect biomarker levels and visit rates, and learn the assumptions that make this construction interpretable.

Advanced 12 min read

What You'll Learn

  • Specify a longitudinal biomarker model and a visit-intensity model that share subject-specific random effects
  • Distinguish conditional independence given random effects from marginal dependence
  • Derive the covariance between a biomarker and visit count in a simple shared-intercept model
  • Interpret visit-rate associations in terms of latent biomarker features
  • Assess key assumptions and recognize when the shared-effects construction may be inadequate

Why Share a Subject-Specific Effect?

Patients may differ in persistent ways that affect both their biomarker values and how often they are observed. For example, a latent tendency toward more severe disease could be associated with a higher biomarker trajectory and more frequent clinical visits. A model that represents these features separately can miss their dependence. A shared-random-effects model represents a common source of subject-to-subject variation in both processes.

The key point is that conditional independence is not the same as marginal independence. A biomarker process and a visit process can be independent after conditioning on a subject’s latent random effects, yet dependent when those effects are unobserved. The model describes one particular way that dependence can arise; it does not establish that this is the actual mechanism in a given study.

A Basic Shared-Random-Effects Construction

Let \(Y_{ij}\) be the biomarker measurement for subject \(i\) at visit time \(t_{ij}\), and let \(N_i(t)\) count that subject’s visits by time \(t\). Write \(X_i\) for observed subject-level covariates and \(b_i\) for a vector of subject-specific random effects. One possible longitudinal submodel is

$$ Y_{ij}=m_i(t_{ij})+\varepsilon_{ij}, \qquad m_i(t)=X_i^{\mathsf T}\beta+Z_i(t)^{\mathsf T}b_i. $$

Here \(m_i(t)\) is the subject-specific mean biomarker trajectory, \(\beta\) contains fixed effects, and \(Z_i(t)\) describes how the random effects enter over time. For example, a random intercept and slope give \(Z_i(t)^{\mathsf T}b_i=b_{0i}+b_{1i}t\). A simple visit model specifies the conditional intensity

$$ \lambda_i(t\mid \mathcal{F}_{i,t-},b_i,X_i) = \lambda_0(t)\exp\{\gamma^{\mathsf T}X_i+\alpha^{\mathsf T}b_i\}. $$

In this expression, \(\mathcal{F}_{i,t-}\) denotes the observed history just before time \(t\), \(\lambda_0(t)\) is a baseline visit intensity, and \(\alpha\) describes how the random effects relate to visit intensity. The intensity is the instantaneous expected visit rate conditional on the information in its arguments, not the probability of a visit at an exact instant. The model must use only information available just before \(t\); this is the predictability requirement for an intensity.

Definition: A shared-random-effects model links the longitudinal and visit processes by using the same latent subject-specific random effects in both submodels. Conditional on \(b_i\) and the specified covariates and history, the two processes may be modeled as independent; marginally, they can be dependent because subjects with different \(b_i\) have different biomarker trajectories and visit rates.

A standard version assumes \(b_i\) follows a specified distribution, often a multivariate normal distribution with mean zero and covariance matrix \(D\), and that subjects’ random effects are independent across subjects. The longitudinal errors \(\varepsilon_{ij}\) are commonly assumed to have mean zero conditional on the random effects and covariates, with a specified variance or covariance structure. A further working assumption is that these measurement errors are independent of the visit process conditional on \(b_i\) and the modeled covariates and history. These assumptions are substantive: they say which sources of dependence are represented and which are ruled out.

The shared effect need not be a random intercept alone. If \(b_i=(b_{0i},b_{1i})^{\mathsf T}\) represents a latent starting level and rate of change, then \(\alpha^{\mathsf T}b_i=\alpha_0b_{0i}+\alpha_1b_{1i}\) allows either feature to be associated with visit intensity. The parameters \(\alpha_0\) and \(\alpha_1\) are conditional log-rate associations, given the model’s other terms. They are not automatically causal effects.

Worked Implications of the Shared Effect

Worked Example: A Latent Level and a Visit-Rate Ratio

Suppose the visit intensity is \(\lambda_i(t)=0.30\exp(0.8b_{0i})\) visits per month, with other covariates held fixed. Compare two hypothetical subjects whose random intercepts are \(b_{0A}=0.5\) and \(b_{0B}=0\). In the longitudinal submodel, suppose the random intercept enters the biomarker in its original units.

The modeled mean biomarker for subject A is \(0.5\) units higher than for subject B at each time, because their random-intercept difference is \(0.5-0=0.5\). Their conditional visit-intensity ratio is

$$ \frac{\lambda_A(t)}{\lambda_B(t)} = \frac{0.30\exp(0.8\times 0.5)}{0.30\exp(0.8\times 0)} = \exp(0.4) \approx 1.492. $$

Thus, at the same time and covariate values, the model assigns subject A an instantaneous visit rate about 1.49 times subject B’s. This is a conditional rate comparison associated with the latent intercept difference; it does not mean that subject A will necessarily have 49.2% more visits over a finite period.

Worked Example: Deriving Biomarker–Visit-Count Covariance

Consider a simplified hypothetical model over a fixed two-month interval. Let \(b_i\sim N(0,1)\), let a biomarker measured at a fixed time be \(Y_i=5+b_i+\varepsilon_i\), and assume \(\varepsilon_i\) has mean zero and is independent of \(b_i\) and the visit process conditional on \(b_i\). Given \(b_i\), suppose the visit count \(N_i\) over the interval has mean \(0.6\exp(0.4b_i)\), corresponding to baseline intensity \(0.30\) visits per month. This example uses a Poisson count conditional on \(b_i\) only to make the covariance calculation explicit.

Since the conditional mean of \(N_i\) is \(0.6\exp(0.4b_i)\), and the residual error has conditional mean zero,

$$ \operatorname{Cov}(Y_i,N_i) = \operatorname{Cov}\{b_i,\,0.6\exp(0.4b_i)\}. $$

For a standard normal random variable \(b\), the moment-generating function gives \(E\{\exp(ab)\}=\exp(a^2/2)\). Differentiating with respect to \(a\) gives \(E\{b\exp(ab)\}=a\exp(a^2/2)\). Therefore,

$$ \begin{aligned} \operatorname{Cov}(Y_i,N_i) &=0.6\left[E\{b_i\exp(0.4b_i)\} -E(b_i)E\{\exp(0.4b_i)\}\right]\\ &=0.6(0.4)\exp(0.4^2/2)\\ &=0.24\exp(0.08) \approx 0.2600. \end{aligned} $$

The covariance is positive, in biomarker units multiplied by visits. The marginal expected visit count is \(0.6\exp(0.08)\approx0.6500\) visits. The positive covariance arises because larger values of \(b_i\) raise both the biomarker mean and the conditional expected visit count. The result illustrates marginal dependence; it does not require residual measurement error to cause visits.

Worked Example: How Frequent Visits Change the Mix of Observed Subjects

Suppose a hypothetical population has two equally common latent types, \(b_i=1\) and \(b_i=-1\). Their biomarker values are \(Y_i=10+b_i\), so the population mean is \((11+9)/2=10\) units. Over one time unit, let the conditional expected visit count be \(0.2\exp((\log 2)b_i)\).

For the higher-biomarker type, the expected count is \(0.2\exp(\log 2)=0.4\) visits. For the lower-biomarker type, it is \(0.2\exp(-\log 2)=0.1\) visits. In a large collection of such subjects, the expected number of visits contributed by each type is proportional to its population fraction times its expected count. The fractions are therefore proportional to \(0.5(0.4)=0.20\) and \(0.5(0.1)=0.05\).

The mean biomarker among visits, in the long-run expected-count sense, is

$$ \frac{0.20(11)+0.05(9)}{0.20+0.05} = \frac{2.65}{0.25} = 10.6 \text{ units}. $$

This differs from the population mean of 10 units because the higher-biomarker type contributes more visits. The calculation concerns the distribution of measurements sampled through visits, not a change in the population’s underlying biomarker values.

Why the Dependence Appears

The basic argument can be stated without assuming a particular distribution for \(b_i\). Let \(Y_i(t)\) be a biomarker value and \(N_i(T)\) a visit count. If their conditional covariance given \(b_i\) is zero, then the law of total covariance gives

$$ \operatorname{Cov}\{Y_i(t),N_i(T)\} = E[\operatorname{Cov}\{Y_i(t),N_i(T)\mid b_i\}] + \operatorname{Cov}\{E(Y_i(t)\mid b_i),E\{N_i(T)\mid b_i\}\}. $$

Under conditional independence, the first term is zero. The second term can still be nonzero when the conditional biomarker mean and expected visit count vary together across values of \(b_i\). For example, if both increase with a scalar random intercept, their covariance is generally positive; if one increases and the other decreases, it may be negative. A shared effect creates the possibility of marginal association, not a guarantee that the association has a particular sign.

This argument is the central justification for the construction. It also shows its scope: shared random effects represent dependence induced by common latent subject characteristics. They do not, by themselves, represent every possible dependence, such as a direct effect of a recent observed biomarker on the next visit, unless that history dependence is included in the intensity model.

Assumptions, Checks, and Failure Modes

Interpretation depends on making the model’s conditions explicit. In a basic formulation, assume the following:

  • A coherent latent-effects distribution: the distribution of \(b_i\), including its covariance structure, is specified and describes the subject heterogeneity relevant to both processes.
  • A suitable longitudinal mean and error model: the trajectory \(m_i(t)\) captures the intended biomarker features, and the conditional mean and dependence of \(\varepsilon_{ij}\) are represented adequately.
  • A valid visit intensity: the intensity is nonnegative and predictable from information available before time \(t\). The baseline and covariate terms should allow reasonable variation in visit rates over time.
  • Correct sharing and conditional separation: the specified components of \(b_i\) enter both submodels as intended, and any remaining dependence between measurement errors and visits is absent or modeled.
  • Appropriate observation and follow-up conditions: the time scale, start of follow-up, and end of observation are defined consistently. A terminal event that ends follow-up should not be treated as an ordinary visit; its role must be handled separately.

Useful checks include comparing observed and model-implied visit counts across time and across groups defined by observed biomarker summaries, examining whether residual patterns suggest a misspecified longitudinal trajectory, and checking whether fitted random-effects variation is plausible. Large discrepancies may indicate an unsuitable baseline intensity, an inadequate trajectory, or dependence not captured by the shared effects. Such checks can reveal lack of fit, but they cannot prove that the latent dependence mechanism is correct: the random effects are unobserved, and distinct mechanisms may produce similar observed patterns.

A frequent mistake is to say, “The biomarker is independent of visits because the model assumes conditional independence.” The correction is that the independence applies only after conditioning on \(b_i\) and the modeled covariates and history. Since \(b_i\) varies across subjects and is not directly observed, averaging over it can induce dependence. Another mistake is to interpret \(\alpha\) as the causal effect of changing a biomarker. It is a conditional association between latent effects and visit intensity under the specified model, not a causal effect without additional design and causal assumptions.

How This Construction Differs From Alternatives

A model with a visit process independent of the biomarker process, conditional only on observed covariates, is simpler. It is suitable when that conditional independence is scientifically credible, but it does not capture dependence due to unobserved subject heterogeneity. A current-state-triggered intensity instead makes the visit rate depend directly on the current latent biomarker state; a lagged-measurement model uses a previously observed biomarker value. These alternatives encode different timing and dependence assumptions. Shared effects are especially useful when persistent latent features are the proposed link, while direct state or history terms are needed when the visit mechanism is thought to respond to a current or recent value beyond those persistent features.

The shared-effects model also has limitations. Its conclusions can be sensitive to the assumed random-effects distribution and to the chosen trajectory and intensity forms. Sparse measurements may provide little information about individual trajectories, while few visits may provide little information about visit-rate associations. If important subject-level factors are omitted, the shared effects may absorb several mechanisms without identifying them separately. The model is therefore a structured representation of dependence, not a substitute for careful scientific reasoning or sensitivity checks.

Key takeaway: Sharing random effects allows latent subject characteristics to influence both biomarker trajectories and visit intensity. Conditional independence given those effects can coexist with marginal dependence. Interpret the resulting association only under the stated distributional, longitudinal, intensity, and observation assumptions.

Check Your Understanding

Answer each question, then compare your reasoning with the short solutions.

  1. If a shared random intercept increases the biomarker mean and the visit intensity, why can the marginal biomarker and visit count be dependent even when their conditional covariance given that intercept is zero?
  2. A visit model has intensity \(\lambda_i(t)=0.4\exp(0.5b_i)\). What is the conditional intensity ratio for two subjects whose random effects differ by 1 unit?
  3. Does a positive shared-effect association establish that increasing a patient’s biomarker would cause more visits? Explain.
  4. Name one pattern that could indicate poor fit of the shared-effects construction and one limitation of using diagnostics to assess it.

Solutions. (1) The law of total covariance includes the covariance between the conditional means across values of the random intercept; when both means increase with it, this term can be positive. (2) The ratio is \(\exp(0.5\times1)=\exp(0.5)\approx1.649\), so the subject with the higher random effect has about 1.65 times the conditional intensity. (3) No. The parameter describes a conditional association with a latent effect under the model; it is not a causal effect of intervening on the biomarker. (4) For example, observed visit counts may show time patterns not reproduced by the fitted intensity. Diagnostics can expose discrepancies, but because the random effects are latent, they cannot verify that the assumed shared mechanism is uniquely correct.

Clinical Biostats