Terry edited this page Oct 26, 2016 · 70 revisions

semTools: Useful tools for structural equation modeling

The goal of this package is to collect useful functions for structural equation modeling in a single, easily accessible place. Everyone is invited to send functions to us and we will maintain the functions for you. Click here for the list of all current functionality of this package and the near future development.


[26 October 2016] Latest Update: semTools, Version 0.4-14

Version 0.4-14 of semTools assimilates lavaan's most recent internal changes, so it requires at least lavaan version 0.5-22 (and therefore R >= 3.1). Two new functions, provided by Terrence D. Jorgensen, are available: chisqSmallN and twostage, along with lavaan wrappers lavaan.2stage, cfa.2stage, sem.2stage, and growth.2stage. The first calculates a small-sample correction to the chi-squared test of model fit, as described in:

Nevitt, J., & Hancock, G. R. (2004). Evaluating small sample approaches for model test statistics in structural equation modeling. Multivariate Behavioral Research, 39(3), 439-478. doi:10.1207/S15327906MBR3903_3

The latter functions implement 2-stage ML estimation to handle missing continuous data. You can read the details in:

Savalei, V., & Bentler, P. M. (2009). A two-stage approach to missing data: Theory and application to auxiliary variables. Structural Equation Modeling, 16(3), 477-497. doi:10.1080/10705510903008238

Savalei, V., & Falk, C. F. (2014). Robust two-stage approach outperforms robust full information maximum likelihood with incomplete nonnormal data. Structural Equation Modeling, 21(2), 280-302. doi:10.1080/10705511.2014.882692

A known issue with twostage is that the Satorra-Bentler scaled test statistic of model fit appears too large. Although the formulas appear correct in the source code, there may be an undiscovered bug. For now, only use the residual-based test statistic of model fit, which assumes normally distributed data. Future versions of semTools might also make alternative fit indices available, but for now the user must calculate them manually. The baseline model is available in the fitted model object, so incremental fit indices such as CFI and TLI can be computed.

A bug was fixed in the permuteMeasEq function, but there is still a known issue that will be fixed in the next update to semTools. Windows users who try to use the parallel-computing options in permuteMeasEq will receive an error because the objects in the global environment are not available on the SOCK clusters. Mac and Linux users will not receive an error if they use Fork clusters or the "multicore" option because the clusters will have access to the global environment.


Everyone is invited to be a developer! Here is the list of current developers.


Terrence D. Jorgensen (primary maintainer)

Sunthud Pornprasertmanit

Patrick Miller

Alexander Schoemann


The project is still under development. The package can be installed by copying this line into the R program:


If you are interested in the source code, please click the code tab. You may install the recently developed test version by downloading the latest version from the following link into the current R directory:


Make sure that you have the lavaan package in your personal library and then copy the following line into R:

install.packages("semTools_latestVersion.tar.gz", repos = NULL, type = "source")

Note that latestVersion is the appropriate number of the latest version. For example, "semTools_0.4-14.tar.gz" is used.

Please report any bugs or send any suggestions to Terrence D. Jorgensen by email.


We think that the development of the package is a collaborative work. The maintainers cannot take the credits of others' contributions. If it is possible to cite a paper working on the development of the function, please cite it. Otherwise, please use the following citation:

semTools Contributors. (2016). semTools: Useful tools for structural equation modeling. R package version 0.4-14. Retrived from http://cran.r-project.org/web/packages/semTools/index.html


Version History


The development of semTools has been supported by the University of Kansas Center for Research Methods and Data Analysis.