Group Based Trajectory Modelling (GBTM)

Cédric NOEL - Jang SHILTZ

2026-08-03

Logo
Logo

Introduction

Longitudinal data from repeated measures are often encountered in practice. For each subject, we measure a variable at several different time points. For example, in finance, we can measure the salary of employees over time (Schiltz 2015); in criminology, we can measure physical aggression over time (Nagin 2005); and in medicine, we can measure electroencephalography data over time (Elmer et al. 2019). The family of Latent Growth Models (LGM) studies inter-individual (between-subject) and intra-individual (within-subject) patterns of change over time. This pattern can be represented by time trends or latent trajectories and is influenced by one or more covariates. The complexity of these patterns can be modeled by adding latent classes. The trajectories represent the mean development of an outcome over time for each class.

We introduce \(K\) latent classes, and the assignment of an individual to a class is based on the degree of similarity of their developmental course. These models assume no between-subject variability within a class, and the error variance is assumed to be the same in each class.

Consider a time-varying variable of interest \(Y_{i}\) for an individual \(i\) in a population of size \(N\). Let \(Y_i= (y_{i_{1}},\cdots ,y_{i_{T}})\) be \(T\) measures of the variable \(Y\), taken at times \((t_{1},\cdots ,t_{T})\) for subject \(i\) from a sample of size \(n\). \ Furthermore, we assume conditional independence for the sequential realizations of the elements \(y_{i_{t}}\) over the \(T\) measurement periods, i.e., a value \(y_{i_{t}}\) does not depend on past values \(y_{i_{t'}}\) where \(t'<t\).

We now suppose that the population is divided into \(K\) homogeneous sub-populations \(C_{1},...,C_{K}\). Let \(P^k(Y_i)\) be the probability of \(Y_i\) given membership in group \(C_k\) and \(P(Y_i)\) the unconditional probability of observing the realization \(Y_i\) of \(Y\). Then, \[\begin{equation} P(Y_i)=\sum_{k=1}^{K}P\left(\omega_i\in C_k\right)P^k(Y_i). \end{equation}\]

The density \(f\) of \(Y\) is then described in the form of a mixture model (Nagin 2005) by: \[\begin{equation} f(y_i;\psi)=\sum_{k=1}^{K}\pi_kg_k(y_i;\theta_k). \end{equation}\] and the individuals follow a time-dependent trajectory. The different time values are stored in a vector \(A_i\).

Here, the group probabilities \(\pi_k>0\) denote the probability of a given subject belonging to group \(k\), and they satisfy \(\sum_{k=1}^{K}\pi_k=1\). The parameters \(\theta_{k}\) describe the shape of the trajectories in group \(k\); hence, the model depends on the parameters \(\psi=(K,\pi_1,\cdots,\pi_{K-1}, \theta_1,\cdots, \theta_K)\).

If we further suppose that the trajectories of \(Y\) are influenced by a static set of risk variables \(X=\left(X_{1}\cdots X_{R}\right)\), as well as by a time-dependent covariate \(W\) which is independent of \(X\), we can write the conditional density of \(Y\) given \(X\) and \(W\).

\[\begin{equation} f\left(y_i|x_i,w_i\right)=\sum_{k=1}^{K}\left(P\left(\omega_i\in C_k|X_i=x_i\right)\prod_{t=1}^{T}P\left(Y_{i_t}=y_{i_t}|X_i=x_i,W_i=w_i,\omega_i\in C_k \right)\right) \end{equation}\]

The aim of this package is to provide tools to work with this situation with different densities for \(Y\):

For the first three models, we assume that the trajectories follow a polynomial shape. For the last one, we can specify a particular function for the shape of the trajectories, such as an exponential function.

This package extends the software for SAS or Stata written by Jones et al. (2001).

A complete description of the model and the proof of each method used inside this package can be found in Noel’s thesis, see https://orbilu.uni.lu/.

Getting started

First, we need to load trajeR package.

library(trajeR)

The main function is named trajeR. It fit the model and find parameters to a given degree of polynomial shape. It syntax is

trajeR(
  Y,
  A,
  Risk = NULL,
  TCOV = NULL,
  degre,
  degre.nu = 0,
  Model,
  Method = "L",
  ssigma = FALSE,
  ymax = max(Y) + 1,
  ymin = min(Y) - 1,
  hessian = TRUE,
  itermax = 100,
  paraminit = NULL,
  ProbIRLS = TRUE,
  refgr = 1,
  fct = NULL,
  diffct = NULL,
  nbvar = NULL,
  nls.lmiter = 50
)

The function trajeR accepts R syntax using the ~ operator to define the model.

Arguments

Details

Models for trajeR is, by default, a polynomial regression of the time value parameters for each groups. The number fo group is controlled by the length of the vector beta. We can specify the degree of the polynomial shape for each groups by the vector degre.

Value

The function trajeR returns an S3 object whose class depends on the specified Model: Trajectory.LOGIT, Trajectory.CNORM, Trajectory.ZIP, Trajectory.NL, or Trajectory.BETA.

All returned objects are lists containing the following common components:

Depending on the class, the returned object also contains model-specific components:

Références

Elmer, Jonathan, Bobby L. Jones, Vladimir I. Zadorozhny, et al. 2019. “A Novel Methodological Framework for Multimodality, Trajectory Model-Based Prognostication.” Resuscitation 137 (April): 197–204. https://doi.org/10.1016/j.resuscitation.2019.02.030.
Jones, Bobby L., Daniel S. Nagin, and Kathryn Roeder. 2001. “A SAS Procedure Based on Mixture Models for Estimating Developmental Trajectories.” Sociological Methods & Research 29 (3): 374–93. https://doi.org/10.1177/0049124101029003005.
Nagin, Daniel S. 2005. Group-Based Modeling of Development. Harvard University Press. http://www.jstor.org/stable/j.ctvjf9z1f.
Schiltz, Jang. 2015. A Generalized Finite Mixture Model. July 28. https://orbilu.uni.lu/handle/10993/21868.