Package: nlpsem 0.4

nlpsem: Nonlinear Longitudinal Process in Structural Equation Modeling

Provides computational tools for nonlinear longitudinal models, in particular the intrinsically nonlinear models, in four scenarios: (1) univariate longitudinal processes with growth factors, with or without covariates including time-invariant covariates (TICs) and time-varying covariates (TVCs); (2) multivariate longitudinal processes that facilitate the assessment of correlation or causation between multiple longitudinal variables; (3) multiple-group models for scenarios (1) and (2) to evaluate differences among manifested groups, and (4) longitudinal mixture models for scenarios (1) and (2), with an assumption that trajectories are from multiple latent classes. The methods implemented are introduced in Liu (2025) <doi:10.3758/s13428-025-02596-4>.

Authors:Jin Liu [aut, cre]

nlpsem_0.4.tar.gz
nlpsem_0.4.zip(r-4.7)nlpsem_0.4.zip(r-4.6)nlpsem_0.4.zip(r-4.5)
nlpsem_0.4.tgz(r-4.6-any)nlpsem_0.4.tgz(r-4.5-any)
nlpsem_0.4.tar.gz(r-4.7-any)nlpsem_0.4.tar.gz(r-4.6-any)
nlpsem_0.4.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
nlpsem/json (API)

# Install 'nlpsem' in R:
install.packages('nlpsem', repos = c('https://veronica0206.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/veronica0206/nlpsem/issues

Datasets:
  • RMS_dat - ECLS-K (2011) Sample Dataset for Demonstration

On CRAN:

Conda:

7.58 score 145 stars 33 scripts 566 downloads 17 exports 52 dependencies

Last updated from:fac8faa673. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK274
source / vignettesOK276
linux-release-x86_64OK272
macos-release-arm64OK357
macos-oldrel-arm64OK196
windows-develOK250
windows-releaseOK227
windows-oldrelOK237
wasm-releaseOK171

Exports:getEstimateStatsgetFiguregetIndFSgetLatentKappagetLCSMgetLGCMgetLRTgetMediationgetMGMgetMGroupgetMIXgetPosteriorgetSummarygetTVCmodelModelSummaryprintTableshow

Dependencies:BHbitbit64clicliprcpp11crayondigestdplyrfarvergenericsggplot2gluegtablehmsisobandlabelinglatticelifecyclemagrittrMASSMatrixmvtnormnnetOpenMxpillarpkgconfigprettyunitsprogresspurrrR6RColorBrewerRcppRcppEigenRcppParallelreadrrlangrpfS7scalesStanHeadersstringistringrtibbletidyrtidyselecttzdbutf8vctrsviridisLitevroomwithr

Examples of Latent Change Score Models
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: Fit nonparametric LCSMs to assess the development of reading ability from Kindergarten to Grade 5, both with and without incorporating baseline teacher-reported approach to learning and attentional focus. The getSummary() function is used to generate a comprehensive summary table for these two models. Additionally, the visual representations of the growth rate and change from the baseline for both models. | Example 2: Fit LCSMs with quadratic, negative exponential and Jenss-Bayley functional forms. Additionally, the visual representations change from the baseline for three models.

Last update: 2026-03-26
Started: 2023-06-04

Examples of Latent Growth Curve Models
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: Fit bilinear spline LGCMs with both a random and a fixed knot to evaluate the development of mathematics ability from Kindergarten to Grade 5. These models are then compared using a likelihood ratio test (LRT) utilizing the getLRT() function. | Example 2: Fit the full bilinear spline LGCM to assess the development of mathematics skill from Kindergarten to Grade 5. This model includes two growth time-invariant covariates (TICs), baseline values of teacher-reported approach to learning and attentional focus. Point estimates and corresponding standard errors (SEs) of all parameters are presented within the original parameter space. The plot of the growth status of mathematics ability is also provided.

Last update: 2026-03-26
Started: 2023-06-04

Examples of Longitudinal Mediation Models
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: Fit longitudinal mediation model with a bilinear spline functional form to assess how the baseline teacher-reported approach to learning influences the development of mathematics ability, mediated through the development of reading ability. | Example 2: Fit longitudinal mediation model with a bilinear spline functional form to assess how the development of reading ability influences the development of science ability, mediated through the development of mathematics ability.

Last update: 2026-03-26
Started: 2023-06-04

Examples of Multivariate Longitudinal Models
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: Fit multivariate bilinear spline LGCMs fixed knots to evaluate the development of reading and mathematics ability from Kindergarten to Grade 5. | Example 2: Fit multivariate bilinear spline LGCMs with random knots to evaluate the development of reading and mathematics ability from Kindergarten to Grade 5.

Last update: 2026-03-26
Started: 2023-06-04

Multiple-group Longitudinal Models
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: Fit multiple group bilinear spline LGCM to evaluate the difference in the development of mathematics ability | Example 2: Fit multiple group negative exponential LGCM with time-invariant covariates (TICs) to evaluate the difference in the development of reading ability. This model includes two growth TICs, baseline values of teacher-reported approach to learning and attentional focus. Point estimates and corresponding standard errors (SEs) of all parameters are presented within the original parameter space.

Last update: 2026-03-26
Started: 2023-06-04

Examples of Longitudinal Mixture Models
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: Fit bilinear spline LGCMs with 1-, 2-, and 3- latent classes to examine the heterogeneity in the development of mathematics skills. The enumeration process is conducted using the getSummary() function, with HetModels = TRUE specified. | Example 2: Fit reduced bilinear spline bivariate LGCMs with three latent classes to analyze the heterogeneity in the co-development of reading and mathematics skills.

Last update: 2026-03-26
Started: 2023-06-04

Examples of Longitudinal Models with Time-varying Covariates
Load nlpsem package, dependent packages and set CSOLNP as the optimizer | Load pre-computed models | Load example data and preprocess data | Example 1: This example includes two models. Model 1 is a full bilinear spline LGCM with a TVC to examine the influence of baseline teacher-reported approach to learning and the development in reading ability on the development of mathematics ability. It also includes a visualization showcasing the growth status of mathematics ability. Model 2 is a full bilinear spline LGCM with a decomposed TVC (interval-specific slopes) to examine the influence of baseline teacher-reported approach to learning and the development in reading ability on the development of mathematics ability. P values and Wald confidence intervals of all parameters are provided. It also includes a visualization showcasing the growth status of mathematics ability. | Example 2: Fit reduced bilinear spline LGCMs with a decomposed TVC (interval-specific slopes, interval-specific changes, and change from baseline) to examine the influence of baseline teacher-reported approach to learning and the development in reading ability on the development of mathematics ability. It also includes a visualization showcasing the growth status of mathematics ability.

Last update: 2026-03-26
Started: 2023-06-04

Introduction to nlpsem
Overview | Modeling Scenarios | Supported Growth Curve Functions | Quick-Start Example | Data Preparation | Fitting a Latent Growth Curve Model | Post-Processing | Model Fit Summary | Parameter Inference | Visualization | Other Useful Functions | Further Reading

Last update: 2026-03-26
Started: 2026-03-26

Readme and manuals

Help Manual

Help pageTopics
S4 Class for displaying figuresfigOutput-class
S4 Class for estimated factor scores and their standard errors.FSOutput-class
Calculate p-Values and Confidence Intervals of Parameters for a Fitted ModelgetEstimateStats
Generate Visualization for Fitted ModelgetFigure
Derive Individual Factor Scores for Each Latent Variable Included in ModelgetIndFS
Compute Latent Kappa Coefficient for Agreement between Two Latent Label SetsgetLatentKappa
Fit a Latent Change Score Model with a Time-invariant Covariate (If Any)getLCSM
Fit a Latent Growth Curve Model with Time-invariant Covariate (If Any)getLGCM
Perform Bootstrap Likelihood Ratio Test for Comparing Full and Reduced ModelsgetLRT
Fit a Longitudinal Mediation ModelgetMediation
Fit a Multivariate Latent Growth Curve Model or Multivariate Latent Change Score ModelgetMGM
Fit a Longitudinal Multiple Group ModelgetMGroup
Fit a Longitudinal Mixture ModelgetMIX
Compute Posterior Probabilities, Cluster Assignments, and Model Entropy for a Longitudinal Mixture ModelgetPosterior
Summarize Model Fit Statistics for Fitted ModelsgetSummary
Fit a Latent Growth Curve Model or Latent Change Score Model with Time-varying and Time-invariant CovariatesgetTVCmodel
S4 Class for kappa statistic with confidence interval and judgment.KappaOutput-class
S4 Generic for summarizing an optimized MxModel.ModelSummary
S4 Method for summarizing an optimized MxModel.ModelSummary,myMxOutput-method
S4 Class for optimized MxModel and point estimates with standard errors (when applicable)myMxOutput-class
S4 Class for posterior probabilities, membership, entropy, and accuracy (when applicable)postOutput-class
S4 Generic for displaying output in a table format.printTable
S4 Method for printing estimated factor scores and their standard errorsprintTable,FSOutput-method
S4 Method for printing kappa statistic with 95% CI and judgement for agreement.printTable,KappaOutput-method
S4 Method for printing point estimates with standard errorsprintTable,myMxOutput-method
S4 Method for printing posterior probabilities, membership, entropy, and accuracy.printTable,postOutput-method
S4 Method for printing p values and confidence intervals (when applicable)printTable,StatsOutput-method
ECLS-K (2011) Sample Dataset for DemonstrationRMS_dat
S4 Method for displaying figures.show,figOutput-method
S4 Class for p values and confidence intervals (when specified).StatsOutput-class