getLCSM.mxModel: Construct An Object of mxModel for Latent Change Score Model...

View source: R/LCSM.mxModel_helper.R

getLCSM.mxModelR Documentation

Construct An Object of mxModel for Latent Change Score Model with Time-invariant Covariates (If Any) To Be Evaluated

Description

This function builds up an object of mxModel for a Latent Change Score Model with user-specified functional form (including whether intrinsically nonlinear) with time-invariant covariates (if any).

Usage

getLCSM.mxModel(
  dat,
  t_var,
  y_var,
  curveFun,
  intrinsic,
  records,
  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, and time-invariant covariates (TICs) if any. It takes the value passed from getLCSM().

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 getLCSM().

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 getLCSM().

curveFun

A string specifying the functional form of the growth curve. Supported options for latent change score models include: "quadratic" (or "QUAD"), "negative exponential" (or "EXP"), "Jenss-Bayley" (or "JB"), and "nonparametric" (or "NonP"). It takes the value passed from getLCSM().

intrinsic

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

records

A numeric vector specifying indices of the study waves. It takes the value passed from getLCSM().

growth_TIC

A string or character vector specifying the column name(s) of time-invariant covariate(s) contributing to the variability of growth factors if any. It takes the value passed from getLCSM().

starts

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

Value

A pre-optimized mxModel for a Latent Change Score Model.


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