Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Class-Specific Covariate Effects

Latent Class Joint Models · Tutorial 453 of 697

Class-Specific Covariate Effects

Learn to separate covariate effects across the class-membership, longitudinal, and event components of a latent-class joint model.

Advanced 13 min read

What You'll Learn

  • Distinguish class-membership effects from within-class longitudinal and event effects.
  • Interpret multinomial-logit coefficients as changes in class-versus-reference-class odds.
  • Interpret longitudinal coefficients in outcome units and hazard coefficients as conditional hazard ratios.
  • Work through a model where one covariate has different effects in all three components.
  • Identify assumptions, diagnostics, and limitations of class-specific covariate effects.

One Covariate, Three Different Roles

In a latent-class joint model, a baseline covariate can be related to several parts of the data-generating model. It may predict which latent trajectory class a subject belongs to, be associated with that subject’s longitudinal measurements within a class, and be associated with the subject’s event hazard within a class. These are distinct effects, even when the same covariate appears in all three components.

For example, a baseline risk factor might be associated with greater odds of belonging to a class with a particular trajectory. Within that class, it might also be associated with a lower measured outcome over time, while separately being associated with a higher event hazard. The coefficients are not interchangeable: they have different scales, condition on different quantities, and answer different questions.

Definition: Let \(C_i\) denote subject \(i\)'s latent class, \(x_i\) a baseline covariate, \(Y_{ij}\) the longitudinal measurement at time \(t_{ij}\), \(T_i\) the event time, and \(\delta_i\) the event indicator. A class-specific covariate-effects model allows \(x_i\) to have separate parameters in (1) the model for \(P(C_i=k\mid x_i)\), (2) the conditional distribution or mean of \(Y_{ij}\) given \(C_i=k\), and (3) the event hazard given \(C_i=k\). The parameters are component-specific and need not be equal.

The model below uses a baseline-category multinomial logit for class membership, a linear mean model for the longitudinal outcome, and a proportional-hazards model for the event. These are useful standard choices, not requirements of every latent-class joint model. Their assumptions must be assessed in the application.

Specify the Three Components Separately

Take class 1 as the reference class. For \(k=2,\ldots,K\), model class membership by

$$ \log\left\{\frac{P(C_i=k\mid x_i)}{P(C_i=1\mid x_i)}\right\} =\alpha_k+a_k x_i . $$

Here \(a_k\) is the change in the log odds of class \(k\) versus class 1 for a one-unit increase in \(x_i\). Thus, \(\exp(a_k)\) is the multiplicative change in those relative odds per one-unit increase. It is not, by itself, a change in the probability of belonging to class \(k\). The class probabilities depend on the predictors for all classes.

For a simple longitudinal component, suppose the conditional mean is linear in time and in the covariate:

$$ E(Y_{ij}\mid C_i=k,x_i,t_{ij}) =\beta_{0k}+\beta_{1k}t_{ij}+\gamma_k x_i . $$

The coefficient \(\gamma_k\) is the difference in mean outcome per one-unit difference in \(x_i\), at the same time and within class \(k\). Without a time-by-covariate interaction, the model assumes the covariate difference in mean outcome is constant over time. If the scientific question calls for a changing difference, one can add \(\eta_k x_i t_{ij}\); then the covariate contrast at time \(t\) is \(\gamma_k+\eta_k t\).

For the event component, a class-specific proportional-hazards model is

$$ \lambda_i(t\mid C_i=k,x_i) =\lambda_{0k}(t)\exp(\theta_k x_i). $$

Here \(\lambda_{0k}(t)\) is the baseline hazard in class \(k\), and \(\theta_k\) is the log hazard ratio per one-unit increase in \(x_i\), conditional on class and the covariates in the model. The proportional-hazards assumption means that this covariate’s hazard ratio does not vary with time within class \(k\). The hazard describes the instantaneous event rate among subjects still event-free at time \(t\); it is not a probability of an event by time \(t\).

Model assumptions: These specifications assume the chosen class-membership link and covariate form are appropriate; the longitudinal mean form is appropriate within each class; and the event model’s proportional-hazards form is appropriate if it is used. The joint model must also specify its within-class dependence structure. In a conditionally independent version, longitudinal and event observations are independent given class and modeled covariates; if random effects are included, the independence statement is conditional on those effects as well. Censoring must be noninformative conditional on the model variables for the event likelihood being used.

Worked Example: Class-Membership Odds

Worked Example: Class-Membership Odds

Suppose there are three classes and \(x_i\) indicates a baseline exposure, with \(x_i=1\) for exposed subjects and \(x_i=0\) otherwise. The class-membership logits are

$$ \log\left\{\frac{P(C_i=2\mid x_i)}{P(C_i=1\mid x_i)}\right\}=-0.70+0.40x_i,\qquad \log\left\{\frac{P(C_i=3\mid x_i)}{P(C_i=1\mid x_i)}\right\}=-1.20-1.40x_i . $$

For class 2 versus class 1, the exposed-versus-unexposed odds ratio is the exponential of the covariate coefficient:

$$ \frac{\{P(C_i=2\mid x_i=1)/P(C_i=1\mid x_i=1)\}} {\{P(C_i=2\mid x_i=0)/P(C_i=1\mid x_i=0)\}} =\exp(0.40)\approx 1.492. $$

Thus the relative odds of class 2 rather than class 1 are about 1.49 times as large for exposed subjects as for unexposed subjects. For class 3 versus class 1, the corresponding ratio is \(\exp(-1.40)\approx 0.2466\), so the relative odds are about 0.247 times as large.

The intercepts also matter when finding class probabilities. For an unexposed subject, the class-specific relative odds against class 1 are \(1\), \(\exp(-0.70)\approx0.4966\), and \(\exp(-1.20)\approx0.3012\). Dividing each by their sum, \(1+0.4966+0.3012=1.7978\), gives probabilities approximately \(0.5562\), \(0.2762\), and \(0.1675\). For an exposed subject the relative odds are \(1\), \(\exp(-0.30)\approx0.7408\), and \(\exp(-2.60)\approx0.07427\); their sum is \(1.8151\), giving probabilities approximately \(0.5509\), \(0.4081\), and \(0.04092\). The class 2 probability rises by about 0.132, but that probability difference is not the odds ratio.

Worked Example: Longitudinal and Event Effects

Worked Example: Longitudinal and Event Effects

Suppose the outcome is a symptom score in points and time is measured in years. In class 2, the fitted conditional mean is \(10+1.5t-0.8x\). At year 2, the predicted means for \(x=0\) and \(x=1\) are \(10+1.5(2)=13.0\) points and \(10+1.5(2)-0.8=12.2\) points. The model therefore estimates a 0.8-point lower mean score for exposed subjects at that time, conditional on class 2. Because there is no \(x\)-by-time term, the fitted contrast is also \(-0.8\) points at other times in the modeled range.

Now suppose the class-2 event model has \(\theta_2=\log(1.60)\), and the class-2 baseline hazard at a particular time is \(0.020\) events per person-year. The hazard ratio for \(x=1\) versus \(x=0\), within class 2, is

$$ \exp(\theta_2)=\exp\{\log(1.60)\}=1.60. $$

At that time, the fitted hazards are \(0.020\) events per person-year for \(x=0\) and \(0.020(1.60)=0.0320\) events per person-year for \(x=1\). This is a conditional hazard comparison, not a statement that exposed subjects have a 60% higher probability of experiencing the event over a specified follow-up period.

The three effects answer different questions: the membership coefficient compares relative class odds, the longitudinal coefficient compares mean symptom scores, and the hazard coefficient compares instantaneous event rates. Their numerical values should not be compared directly.

Why the Effects Are Distinct

The distinction follows directly from the model equations. For a one-unit change in \(x_i\), the membership log-odds contrast is

$$ \left(\alpha_k+a_k(x_i+1)\right)-\left(\alpha_k+a_kx_i\right)=a_k, $$

so exponentiating gives the relative-odds ratio \(\exp(a_k)\). In the longitudinal mean model, the corresponding contrast at fixed class and time is

$$ \{\beta_{0k}+\beta_{1k}t+\gamma_k(x_i+1)\} -\{\beta_{0k}+\beta_{1k}t+\gamma_kx_i\} =\gamma_k. $$

In the event model, the ratio of hazards at the same time and in the same class is

$$ \frac{\lambda_{0k}(t)\exp\{\theta_k(x_i+1)\}} {\lambda_{0k}(t)\exp(\theta_k x_i)} =\exp(\theta_k). $$

These calculations also show why a class-specific predictor value cannot be mistaken for a covariate effect. The odds ratio for a one-unit covariate contrast comes from the coefficient \(a_k\), not from exponentiating the entire class-membership linear predictor for just one covariate value.

Comparison, Diagnostics, and Limitations

A model allowing separate effects can be compared conceptually with more restricted specifications. A common-slope model constrains, for example, \(\gamma_k\) to be equal across classes; a model omitting \(x_i\) from the longitudinal component sets those effects to zero; and a membership-only model allows \(x_i\) to predict class without a within-class outcome association. These restrictions encode different scientific assumptions. If uncertainty about a restriction matters, estimate and report the relevant contrast with its uncertainty; model comparison procedures must account for the latent-class estimation setting rather than being applied mechanically.

Diagnostics should be matched to each component. Check whether the class-membership relationship is plausible over the observed covariate range and whether some covariate patterns nearly determine class membership. Within classes, inspect whether the longitudinal mean form and residual behavior are adequate, including whether a covariate-by-time interaction is needed. For the event component, assess whether the proportional-hazards assumption is tenable and whether each class has enough events and covariate variation to estimate its effect. Check convergence and sensitivity to starting values as well: unstable estimates can make apparent class-specific differences unreliable.

A coefficient in this model is an adjusted association under the specified model, not automatically a causal effect. Class membership is latent, and conditioning on a latent class is not the same as randomizing subjects to classes. Causal interpretations require additional design and identification assumptions. Also, if \(x_i\) is poorly supported in some classes, the corresponding class-specific effect may be imprecise or driven by extrapolation. A numerical estimate does not ensure that each class contains adequate information.

Common pitfall: Exponentiating a subject’s class-membership linear predictor gives that subject’s class-\(k\)-versus-reference-class odds. It does not give the covariate odds ratio. To compare \(x=1\) with \(x=0\), subtract the two predictors; under the linear logit model the difference is \(a_k\), so the odds ratio is \(\exp(a_k)\). Likewise, \(\exp(\theta_k)\) is a within-class hazard ratio, not a class-membership odds ratio.

Class-specific effects are useful when the same covariate may relate differently to latent trajectory groups, measured outcomes, and event risk. Their flexibility is also a limitation: more parameters require more information, and results depend on the chosen class structure and component models. Report which component each coefficient belongs to, its contrast and units, and the class conditioning used in its interpretation.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. If \(a_3=0.25\), what is the class-3-versus-class-1 odds ratio for a one-unit increase in \(x\)?
  2. In a longitudinal model with \(\gamma_2=1.2\), what does the coefficient mean if the outcome is measured in millimeters?
  3. If \(\theta_1=-0.30\), what is the within-class hazard ratio for a one-unit increase in \(x\)?
  4. Why is \(\exp(\alpha_2+a_2x)\) not generally the covariate odds ratio for class 2 versus class 1?

Solutions. (1) \(\exp(0.25)\approx1.284\): the relative odds are about 1.28 times as large per one-unit increase. (2) At fixed time and within class 2, the conditional mean outcome is 1.2 mm higher per one-unit increase in \(x\), under the stated model. (3) \(\exp(-0.30)\approx0.7408\), a within-class hazard ratio below 1. (4) It is the class-2-versus-class-1 odds at a particular value of \(x\). The odds ratio comparing \(x+1\) with \(x\) is obtained by subtracting predictors, giving \(a_2\), and exponentiating: \(\exp(a_2)\).

Clinical Biostats