We present the R package nlpsem, which provides a comprehensive set of functions to assess longitudinal processes with individual measurement occasions within the structural equation modeling (SEM) framework. This package focuses on providing computational tools for nonlinear longitudinal models, particularly intrinsically nonlinear models, across four distinct scenarios: (1) univariate longitudinal processes captured by latent variables, with or without covariates, including time-invariant covariates (TICs) and time-varying covariates (TVCs); (2) multivariate longitudinal processes for evaluating correlations or causations between longitudinal variables; (3) multiple-group frameworks for models in scenarios (1) and (2), enabling the examination of differences between manifested classes; and (4) mixture models for scenarios (1) and (2), assuming that trajectories originate from heterogeneous latent classes. By interfacing with the R package OpenMx, nlpsem enables flexible specification of structural equation models and generates maximum likelihood estimators using the full information maximum likelihood technique. The package includes an algorithm to obtain initial values from raw data, thereby facilitating computation and enhancing the likelihood of model convergence. Additionally, nlpsem provides functions for goodness-of-fit analyses, clustering analyses, plots, and predicted trajectories. This paper constitutes a companion to the package, detailing each model scenario, the estimation technique, implementation details, output interpretation, and showcasing examples through a dataset on intelligence development.
翻译:我们介绍了R包nlpsem,该包提供了一套全面的函数,用于在结构方程模型框架内评估具有个体测量时点的纵向过程。该包专注于为非线性纵向模型(特别是本质非线性模型)提供计算工具,涵盖四种不同的场景:(1)由潜变量捕获的单变量纵向过程,可包含或不包含协变量,包括时不变协变量和时变协变量;(2)用于评估纵向变量之间相关性或因果关系的多变量纵向过程;(3)针对场景(1)和(2)中模型的多组框架,使得能够检验显式组别之间的差异;以及(4)场景(1)和(2)的混合模型,假设轨迹源自异质潜类别。通过与R包OpenMx接口,nlpsem能够灵活指定结构方程模型,并利用全信息最大似然技术生成最大似然估计量。该包包含一个从原始数据获取初始值的算法,从而促进计算并提高模型收敛的可能性。此外,nlpsem还提供了用于拟合优度分析、聚类分析、绘图和预测轨迹的函数。本文是该包的配套说明,详细阐述了每个模型场景、估计技术、实现细节、输出解释,并通过一个智力发展数据集展示了示例。