Learn R Programming

trajeR (version 1.0)

trajeR_mult: Fitting Multivariate Longitudinal Mixture Models

Description

Fits a multivariate (joint) group-based trajectory model for multiple longitudinal outcomes.

Usage

trajeR_mult(
  formulas,
  ng,
  models,
  Method = "L",
  Risk = NULL,
  TCOV = NULL,
  data = NULL,
  degre.nu = NULL,
  degre.phi = NULL,
  ssigma = TRUE,
  ymax = NULL,
  ymin = NULL,
  paraminit = NULL,
  control = list(maxit = 100),
  hessian = FALSE
)

Value

An object of class trajectory.mult containing the fitted model parameters for each outcome, the interaction parameters (psi), likelihood, and convergence status.

Arguments

formulas

A list of formulas, one for each longitudinal outcome (e.g., list(Y1 ~ Time, Y2 ~ Time + I(Time^2))).

ng

A list of integers specifying the number of latent groups for each outcome.

models

A character vector of distribution models for each outcome (e.g., c("CNORM", "LOGIT")). Supported models are "CNORM", "LOGIT", "ZIP", "BETA", "POIS".

Method

The estimation method. "L" for Likelihood or "EM" for Expectation-Maximization.

Risk

An optional one-sided formula for global risk factors that influence group membership (e.g., ~ X1 + X2).

TCOV

Formula or Matrix. Optional time-dependent covariates.

data

data.frame. The dataset containing all variables.

degre.nu

A list or vector specifying the polynomial degree for the zero-inflation part of "ZIP" models.

degre.phi

A list or vector specifying the polynomial degree for the precision parameter (phi) of "BETA" models.

ssigma

Logical. If TRUE, assumes a common standard deviation across groups for "CNORM" models. Can be a vector of logicals, one for each CNORM model. Default is TRUE.

ymax

A list or vector of maximum values for censoring in "CNORM" models.

ymin

A list or vector of minimum values for censoring in "CNORM" models.

paraminit

An optional list of numeric vectors for user-defined initial parameters. The list should have one element per model, plus an optional last element for the psi parameters.

control

A list of control parameters for the optimization algorithm (e.g., list(maxit=100)).

hessian

Logical. If TRUE, computes the Hessian matrix to estimate standard errors. Default is FALSE.