semtools: Methods for Structural Equation Models
Unless otherwise noted, all code on this page is released under the GPL-3 license.
Identification and scaling of latent variables in ordinal factor analysis
- Manuscript published in Psychometrika 91, 508-535.
- Code for reproducing all results. (zip)
- R function for applying integer constraints to other lavaan models. integer_constraint.R
Self-normalized, score-based tests of parameter heterogeneity in mixed models
- Manuscript published in Dependent Data in Social Sciences Research, 377-395.
- Code for application section.
- Code for simulation section.
Computation and application of generalized linear mixed model derivatives using lme4
- Manuscript published in Psychometrika 87, 1173-1193.
- Replication materials hosted on OSF.
Score-based tests for explaining heterogeneity in linear mixed models
- Manuscript published in Behavior Research Methods 53, 216-231.
- Replication materials available here.
Model selection of nested and non-nested item response models using Vuong tests
- Manuscript published in Multivariate Behavioral Research 55(5), 664-684.
- Replication materials available on github.
Bayesian comparison of latent variable models: Conditional vs marginal likelihoods
- Manuscript published in Psychometrika 84(3), 802-829.
- Replication materials:
- Helper functions for obtaining conditional and marginal information criteria from CFA and IRT models.
- Stan code for model estimation in the IRT example.
- Replication script containing code to estimate models and obtain results from the paper, using the above files.
Derivative computations and robust standard errors for linear mixed effects models in lme4
- Manuscript published in Journal of Statistical Software 87(c01), 1-16.
- Replication materials:
- merDeriv package for installation from CRAN.
- estfun method for obtaining scores from models of class lmerMod.
- vcov method for obtaining covariance matrix of all parameters (including random effect parameters) from models of class lmerMod.
- bread function for using the above code in tandem with package sandwich.
- Replication script containing code to run and summarize results from the paper, using the above files.
Score-based tests of differential item functioning in the two-parameter model
- Manuscript published in Psychometrika 83(1), 132-155.
- Replication materials:
- Simulation functions for data generation, power evaluation, and power summaries.
- lavaan extensions containing
estfun()method for lavaan objects estimated via PML and code to simplify model estimation (note: this code relies on lavaan 0.5-17). - Code to obtain scores from specific ltm objects and mirt objects.
- Data from application section
- Replication script containing code to run and summarize the application and simulations, using the above files.
Testing non-nested structural equation models
- Manuscript published in Psychological Methods 21(2), 151-163.
- Replication materials:
- Simulation functions for data generation, power evaluation, and power summaries.
- Burnout data for application.
- Replication script containing code to run and summarize the application and simulations, using the above files.
- Relies on R packages nonnest2 to carry out the tests and lavaan 0.5-17 for model estimation.
Bayesian latent variable models for the analysis of experimental psychology data
- Manuscript published in Psychonomic Bulletin & Review 25(1), 256-270.
- Replication materials:
- JAGS models used in the paper (this file writes JAGS model files when it is sourced in R).
- Peters & Levin (2008) data, used in the application.
- Helper code for computing Bayes factors via the Laplace approximation.
- Replication script containing code to estimate and summarize the analyses, using the above files.
Score-based tests of measurement invariance: Use in practice
- Manuscript published in Frontiers in Psychology 5(438), 1-11.
- Replication materials:
- Model estimation functions for simulations.
- Simulation functions for data generation, power evaluation, and power summaries.
- Replication script containing code to run and summarize the tutorial and simulations, using the above files. (Note: strucchange 1.5-0 and lavaan 0.5-14 contain code necessary to carry out the tests for general SEMs.)
Testing for measurement invariance with respect to an ordinal variable
- Manuscript published in Psychometrika 79(4), 569-584.
- Replication materials:
- lavaan extensions containing
estfun()method for lavaan objects (note: this code has been incorporated into lavaan and is no longer necessary). - strucchange extensions containing
efpFunctionals for ordinal measurement invariance tests. - Artificial example functions for lavaan model estimation, along with score extraction.
- Simulation functions for data generation, power evaluation, and power summaries.
- Replication script containing code to run and summarize the examples and simulations, using the above files.
- lavaan extensions containing
Tests of measurement invariance without subgroups: A generalization of classical methods
- Manuscript published in Psychometrika 78(1), 58-82.
- Psychoco 2012 presentation
- Replication materials:
- lavaan extensions containing
estfun()method for lavaan objects (note: this code has been incorporated into lavaan and is no longer necessary). - Artificial example functions for lavaan or OpenMx model estimation, along with score extraction.
- Simulation functions for data generation, power evaluation, and power summaries.
- Replication script containing code to run and summarize the examples and simulations, using the above files.
- lavaan extensions containing
Acknowledgments
This material is based upon work supported by the U.S. National Science Foundation under Grants SES-1061334 and 1460719. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation (NSF).