getsub.TVC_m: Define a Latent Growth Curve Model or Latent Change Score...

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

getsub.TVC_mR Documentation

Define a Latent Growth Curve Model or Latent Change Score Model with a Time-varying Covariate as Class-specific Models (Submodels) for a Longitudinal Multiple Group Model.

Description

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

Usage

getsub.TVC_m(
  dat,
  nClass,
  grp_var,
  t_var,
  y_var,
  curveFun,
  intrinsic,
  records,
  y_model,
  TVC,
  decompose,
  growth_TIC,
  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 string specifying the prefix of the column names corresponding to the time variable at each study wave. It takes the value passed from getMGroup().

y_var

A string specifying the prefix of the column names corresponding to the 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 numeric vector specifying the indices of the observed study waves. 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().

TVC

A string specifying the prefix of the column names corresponding to the time-varying covariate at each study wave. It takes the value passed from getMGroup().

decompose

An integer specifying the decomposition option for temporal states. Supported values include 0 (no decomposition), 1 (decomposition with interval-specific slopes as temporal states), 2 (decomposition with interval- specific changes as temporal states), and 3 (decomposition with change-from-baseline as temporal states). It takes the value passed from getMGroup().

growth_TIC

A string or character vector specifying the column name(s) of time-invariant covariate(s) that account for the variability of growth factors, if any. 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.