Learn R Programming

⚠️There's a newer version (0.5-6) 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

14,750

Version

0.5-3

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

May 27th, 2020

Functions in semTools (0.5-3)

calculate.D2

Calculate the "D2" statistic
efaUnrotate

Analyze Unrotated Exploratory Factor Analysis Model
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
efa.ekc

Empirical Kaiser criterion
discriminantValidity

Calculate discriminant validity statistics
compareFit

Build an object summarizing fit indices across multiple models
dat2way

Simulated Dataset to Demonstrate Two-way Latent Interaction
findRMSEApower

Find the statistical power based on population RMSEA
findRMSEApowernested

Find power given a sample size in nested model comparison
exLong

Simulated Data set to Demonstrate Longitudinal Measurement Invariance
datCat

Simulated Data set to Demonstrate Categorical Measurement Invariance
dat3way

Simulated Dataset to Demonstrate Three-way Latent Interaction
kd

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

Finding excessive kurtosis
indProd

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

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

Find sample size given a power in nested model comparison
imposeStart

Specify starting values from a lavaan output
fmi

Fraction of Missing Information.
htmt

Assessing Discriminant Validity using Heterotrait-Monotrait Ratio
mardiaSkew

Finding Mardia's multivariate skewness
lavaan.mi-class

Class for a lavaan Model Fitted to Multiple Imputations
lavTestWald.mi

Wald Test for Multiple Imputations
longInvariance-deprecated

Measurement Invariance Tests Within Person
mardiaKurtosis

Finding Mardia's multivariate kurtosis
lavaan2emmeans

emmeans Support Functions for lavaan Models
loadingFromAlpha

Find standardized factor loading from coefficient alpha
lavTestLRT.mi

Likelihood Ratio Test for Multiple Imputations
lavTestScore.mi

Score Test for Multiple Imputations
modindices.mi

Modification Indices for Multiple Imputations
miPowerFit

Modification indices and their power approach for model fit evaluation
maximalRelia

Calculate maximal reliability
measurementInvariance-deprecated

Measurement Invariance Tests
measEq.syntax-class

Class for Representing a Measurement-Equivalence Model
measEq.syntax

Syntax for measurement equivalence
measurementInvarianceCat-deprecated

Measurement Invariance Tests for Categorical Items
monteCarloMed

Monte Carlo Confidence Intervals to Test Complex Indirect Effects
moreFitIndices

Calculate more fit indices
net

Nesting and Equivalence Testing
mvrnonnorm

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

Plot power curves for RMSEA
nullRMSEA

Calculate the RMSEA of the null model
parcelAllocation

Random Allocation of Items to Parcels in a Structural Equation Model
plotProbe

Plot a latent interaction
plotRMSEAdist

Plot the sampling distributions of RMSEA
partialInvariance

Partial Measurement Invariance Testing Across Groups
permuteMeasEq-class

Class for the Results of Permutation Randomization Tests of Measurement Equivalence and DIF
permuteMeasEq

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

Plot power of nested model RMSEA
plausibleValues

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

Residual-center all target indicators by covariates
orthRotate

Implement orthogonal or oblique rotation
probe2WayMC

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

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

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

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

Calculate the reliability values of a second-order factor
reliability

Calculate reliability values of factors
quark

Quark
probe3WayRC

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

semTools: Useful Tools for Structural Equation Modeling
simParcel

Simulated Data set to Demonstrate Random Allocations of Parcels
runMI

Fit a lavaan Model to Multiple Imputed Data Sets
semTools-deprecated

Deprecated functions in package semTools.
twostage

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

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

Finding skewness
singleParamTest

Single Parameter Test Divided from Nested Model Comparison
splitSample

Randomly Split a Data Set into Halves
tukeySEM

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

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

Class For the Result of Nesting and Equivalence Testing
auxiliary

Implement Saturated Correlates with FIML
EFA-class

Class For Rotated Results from EFA
FitDiff-class

Class For Representing A Template of Model Fit Comparisons
PAVranking

Parcel-Allocation Variability in Model Ranking
SSpower

Power for model parameters
chisqSmallN

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

Bollen-Stine Bootstrap with the Existence of Missing Data