getsub.MGM_m: Define Multivariate Latent Growth Curve Models or...

View source: R/MGroup.SUBMODEL.MGM_helper.R

getsub.MGM_mR Documentation

Define Multivariate Latent Growth Curve Models or Multivariate Latent Change Score Models as Class-specific Models (Submodels) for a Longitudinal Multiple Group Model

Description

This function defines multivariate latent growth curve models or multivariate latent change score models as class- specific models (submodels) for a longitudinal multiple group model.

Usage

getsub.MGM_m(
  dat,
  nClass,
  grp_var,
  t_var,
  y_var,
  curveFun,
  intrinsic,
  records,
  y_model,
  starts
)

Arguments

dat

A wide-format data frame, with each row corresponding to a unique ID. It contains the observed variables with repeated measurements and occasions for each longitudinal process, and time-invariant covariates (TICs) if any. It takes the value passed from getMGroup().

nClass

An integer specifying the number of manifested classes for the multiple group model. It takes the value passed from getMGroup().

grp_var

A string specifying the column that indicates manifested classes. It takes the value passed from getMGroup().

t_var

A vector of strings, with each element representing the prefix for column names related to the time variable for the corresponding outcome variable at each study wave. It takes the value passed from getMGroup().

y_var

A vector of strings, with each element representing the prefix for column names corresponding to a particular outcome variable at each study wave. It takes the value passed from getMGroup().

curveFun

A string specifying the functional form of the growth curve. Supported options for y_model = "LGCM" include: "linear" (or "LIN"), "quadratic" (or "QUAD"), "negative exponential" (or "EXP"), "Jenss-Bayley" (or "JB"), and "bilinear spline" (or "BLS"). Supported options for y_model = "LCSM" include: "quadratic" (or "QUAD"), "negative exponential" (or "EXP"), "Jenss-Bayley" (or "JB"), and "nonparametric" (or "NonP"). It takes the value passed from getMGroup().

intrinsic

A logical flag indicating whether to build an intrinsically nonlinear longitudinal model. It takes the value passed from getMGroup().

records

A list of numeric vectors, with each vector specifying the indices of the observed study waves for the corresponding outcome variable. It takes the value passed from getMGroup().

y_model

A string specifying how to fit the longitudinal outcome. Supported values are "LGCM" and "LCSM". It takes the value passed from getMGroup().

starts

A list of initial values for the parameters, either takes the value passed from getMGroup() or derived by the helper function getMGroup.initial().

Value

A list of manifest and latent variables and paths for an mxModel object.


nlpsem documentation built on Sept. 13, 2023, 1:06 a.m.