Learn R Programming

⚠️There's a newer version (0.5-7) of this package.Take me there.

semTools

Useful tools for structural equation modeling.

This is an R package whose primary purpose is to extend the functionality of the R package lavaan. There are several suites of tools in the package, which correspond to the same theme. To browse these suites, open the help page at the Console:

?semTools::`semTools-package`

Additional tools are available to do not require users to rely on any R packages for SEM (e.g., lavaan, OpenMx, or sem), as long as their other software provides the information they need. Examples:

  • monteCarloMed() to calculate Monte Carlo confidence intervals for functions of parameters, such as indirect effects in mediation models
  • calculate.D2() to pool z or chi-squared statistics across multiple imputations of missing data
  • indProd() for creating product indicators of latent interactions
  • SSpower() provides analytically derived power estimates for SEMs
  • tukeySEM() for Tukey's WSD post-hoc test of mean-differences under unequal variance and sample size
  • bsBootMiss() to transform incomplete data to be consistent with the null-hypothesized model, appropriate for model-based (a.k.a. "Bollen--Stine") boostrapping

All users of R (or SEM) are invited to submit functions or ideas for functions by contacting the maintainer, Terrence Jorgensen (TJorgensen314 at gmail dot com). Contributors are encouraged to use Roxygen comments to document their contributed code, which is consistent with the rest of semTools. Read the vignette from the roxygen2 package for details:

vignette("rd", package = "roxygen2")

Copy Link

Version

Install

install.packages('semTools')

Monthly Downloads

19,104

Version

0.5-5

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Terry Jorgensen

Last Published

July 7th, 2021

Functions in semTools (0.5-5)

Net-class

Class For the Result of Nesting and Equivalence Testing
FitDiff-class

Class For Representing A Template of Model Fit Comparisons
PAVranking

Parcel-Allocation Variability in Model Ranking
auxiliary

Implement Saturated Correlates with FIML
calculate.D2

Calculate the "D2" statistic
BootMiss-class

Class For the Results of Bollen-Stine Bootstrap with Incomplete Data
SSpower

Power for model parameters
chisqSmallN

Small-N correction for \(chi^2\) test statistic
bsBootMiss

Bollen-Stine Bootstrap with the Existence of Missing Data
EFA-class

Class For Rotated Results from EFA
efaUnrotate

Analyze Unrotated Exploratory Factor Analysis Model
dat2way

Simulated Dataset to Demonstrate Two-way Latent Interaction
findRMSEAsamplesize

Find the minimum sample size for a given statistical power based on population RMSEA
compareFit

Build an object summarizing fit indices across multiple models
findRMSEAsamplesizenested

Find sample size given a power in nested model comparison
htmt

Assessing Discriminant Validity using Heterotrait-Monotrait Ratio
fmi

Fraction of Missing Information.
imposeStart

Specify starting values from a lavaan output
combinequark

Combine the results from the quark function
clipboard

Copy or save the result of lavaan or FitDiff objects into a clipboard or a file
exLong

Simulated Data set to Demonstrate Longitudinal Measurement Invariance
findRMSEApower

Find the statistical power based on population RMSEA
findRMSEApowernested

Find power given a sample size in nested model comparison
discriminantValidity

Calculate discriminant validity statistics
efa.ekc

Empirical Kaiser criterion
longInvariance-deprecated

Measurement Invariance Tests Within Person
modindices.mi

Modification Indices for Multiple Imputations
monteCarloCI

Monte Carlo Confidence Intervals to Test Functions of Parameter Estimates
lavaan.mi-class

Class for a lavaan Model Fitted to Multiple Imputations
indProd

Make products of indicators using no centering, mean centering, double-mean centering, or residual centering
lrv2ord

Calculate Population Moments for Ordinal Data Treated as Numeric
mardiaKurtosis

Finding Mardia's multivariate kurtosis
lavTestWald.mi

Wald Test for Multiple Imputations
measEq.syntax

Syntax for measurement equivalence
maximalRelia

Calculate maximal reliability
mardiaSkew

Finding Mardia's multivariate skewness
dat3way

Simulated Dataset to Demonstrate Three-way Latent Interaction
measEq.syntax-class

Class for Representing a Measurement-Equivalence Model
plotRMSEApower

Plot power curves for RMSEA
plotRMSEAdist

Plot the sampling distributions of RMSEA
parcelAllocation

Random Allocation of Items to Parcels in a Structural Equation Model
lavTestLRT.mi

Likelihood Ratio Test for Multiple Imputations
partialInvariance

Partial Measurement Invariance Testing Across Groups
lavTestScore.mi

Score Test for Multiple Imputations
kd

Generate data via the Kaiser-Dickman (1962) algorithm.
datCat

Simulated Data set to Demonstrate Categorical Measurement Invariance
kurtosis

Finding excessive kurtosis
lavaan2emmeans

emmeans Support Functions for lavaan Models
measurementInvarianceCat-deprecated

Measurement Invariance Tests for Categorical Items
plotRMSEApowernested

Plot power of nested model RMSEA
poolMAlloc

Pooled estimates and standard errors across M parcel-allocations: Combining sampling variability and parcel-allocation variability.
permuteMeasEq-class

Class for the Results of Permutation Randomization Tests of Measurement Equivalence and DIF
measurementInvariance-deprecated

Measurement Invariance Tests
permuteMeasEq

Permutation Randomization Tests of Measurement Equivalence and Differential Item Functioning (DIF)
reliability

Calculate reliability values of factors
quark

Quark
probe2WayMC

Probing two-way interaction on the no-centered or mean-centered latent interaction
probe2WayRC

Probing two-way interaction on the residual-centered latent interaction
orthRotate

Implement orthogonal or oblique rotation
loadingFromAlpha

Find standardized factor loading from coefficient alpha
tukeySEM

Tukey's WSD post-hoc test of means for unequal variance and sample size
twostage-class

Class for the Results of 2-Stage Maximum Likelihood (TSML) Estimation for Missing Data
runMI

Fit a lavaan Model to Multiple Imputed Data Sets
twostage

Fit a lavaan model using 2-Stage Maximum Likelihood (TSML) estimation for missing data.
mvrnonnorm

Generate Non-normal Data using Vale and Maurelli (1983) method
moreFitIndices

Calculate more fit indices
skew

Finding skewness
splitSample

Randomly Split a Data Set into Halves
probe3WayMC

Probing three-way interaction on the no-centered or mean-centered latent interaction
nullRMSEA

Calculate the RMSEA of the null model
net

Nesting and Equivalence Testing
probe3WayRC

Probing three-way interaction on the residual-centered latent interaction
semTools-deprecated

Deprecated functions in package semTools.
miPowerFit

Modification indices and their power approach for model fit evaluation
semTools

semTools: Useful Tools for Structural Equation Modeling
plotProbe

Plot a latent interaction
plausibleValues

Plausible-Values Imputation of Factor Scores Estimated from a lavaan Model
reliabilityL2

Calculate the reliability values of a second-order factor
residualCovariate

Residual-center all target indicators by covariates
simParcel

Simulated Data set to Demonstrate Random Allocations of Parcels
singleParamTest

Single Parameter Test Divided from Nested Model Comparison