Learn R Programming

A R package that fit regression mixture model - group-based trajectory modeling (GBTM).

Longitudinal studies are often employed on several disciplines like finance, econometrics, psychology, sociology, biology, ...

The aims of this package is to give tools to work with this situation. On the one hand by divide data in some clusters and on the other hand by fitting longitudinal trajectories in each clusters.

Package Functionality

TrajeR support several distributions

  • Censored (or regular) Normal distribution ;
  • Zero Inflated Poisson distribution ;
  • Poisson distribution ;
  • Bernouilli distribution ;
  • Beta distribution (only withe Likelihood) ;
  • Non linear regression.

The trajectories of each clusters are modeling by polynomials. We have the possibility to use Non Linear models too.

Installation

To get the current released version from CRAN.

To get the current development version from Codeberg:

# Install from the git repository
if (!require("devtools")) install.packages("devtools")
devtools::install_git(url = "https://codeberg.org/cidric/trajeR")

Usage

library(trajeR)

The main function of the package is

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

For more details about the usage of this package you can read the vignette documentation (coming soon).

Contact

Cédric NOEL

cedric.noel@univ-lorraine.fr

Copy Link

Version

Install

install.packages('trajeR')

Monthly Downloads

455

Version

1.0

License

GPL (>= 2)

Maintainer

Cc3<a9>dric NOEL

Last Published

August 3rd, 2026

Functions in trajeR (1.0)

plotrajeR.Trajectory.CNORM

Plot Method for CNORM Trajectory Objects
fait

Function fait
trajeR.LOGIT

Internal function to fit LOGIT Model
print.Trajectory.NL

Print Method for a `Trajectory.NL` Object
print.Trajectory.POIS

Print Method for a `Trajectory.ZIP` Object
diffaitbeta

Differential
trajeR.CNORM

Internal function to fit CNORM Model
data_ZIP

Simulated ZIP Dataset
trajeR.NL

Internal function to fit a Non-Linear Model
data_LOGIT

Simulated LOGIT Dataset
plotrajeR

Plot Group Trajectories from a trajeR Model
plotrajeR.Trajectory.NL

Plot Method for Non-Linear Trajectory Objects
plotrajeR.Trajectory.POIS

Plot Method for POIS Trajectory Objects
plot_trajectory_mult

Plot Multivariate Trajectories
print.Trajectory.CNORM

Print Method for a `Trajectory.CNORM` Object
GroupProfiles

Generate Group Profiles Based on Covariates
get_group_probabilities

Compute Posterior Probabilities and Group Assignments for Multivariate Trajectory Models
plotrajeR.Trajectory.BETA

Plot Method for BETA Trajectory Objects
trajeR

Fitting longitudinal mixture models
print.Trajectory.LOGIT

Print Method for a `Trajectory.LOGIT` Object
plotrajeR.Trajectory.ZIP

Plot Method for ZIP Trajectory Objects
trajeRBIC

Bayesian Information Criterion (BIC) for a Trajectory Object
trajeRAIC

Akaike Information Criterion (AIC) for a Trajectory Object
print.Trajectory.BETA

Print BETA
trajeR.ZIP

Internal function to fit ZIP Model
trajeR.POIS

Internal function to fit Poisson Model
plotrajeR.Trajectory.LOGIT

Plot Method for LOGIT Trajectory Objects
propAssign

Proportion of Individuals Assigned to Each Group
print.Trajectory.ZIP

Print ZIP
print.trajectory.mult

Print Method for a `trajectory.mult` Object
trajeR.BETA

Internal function to fit Beta Regression Model
trajeRSH

Slope Heuristic for Trajectory Model Selection
trajeR_mult

Fitting Multivariate Longitudinal Mixture Models
GroupProb

Calculate Posterior Membership Probabilities
OCC

Odds of Correct Classification (OCC)
data_CNORM_Censored

Simulated Censored CNORM Dataset
ConfIntT

Bootstrap Confidence Intervals for Group Membership Probabilities
confidenceInt

Compute Confidence Intervals for Predicted Trajectories
AvePP

Average Posterior Probability of Assignment
adequacy

Model Adequacy Assessment
data_CNORM

Simulated CNORM Dataset
dataNORM01

Simulated CNORM Dataset (data01)