Learn R Programming

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

lavaan

lavaan is a free, open source R package for latent variable analysis. You can use lavaan to estimate a large variety of multivariate statistical models, including path analysis, confirmatory factor analysis, structural equation modeling and growth curve models.

The lavaan package is developed to provide useRs, researchers and teachers a free open-source, but commercial-quality package for latent variable modeling. The long-term goal of lavaan is to implement all the state-of-the-art capabilities that are currently available in commercial packages. However, lavaan is still under development, and much work still needs to be done.

To get a first impression of how lavaan works in practice, consider the following example of a SEM model (the Political Democracy Example from Bollen's 1989 book):

library(lavaan)

model <- '
   # latent variable definitions
     ind60 =~ x1 + x2 + x3
     dem60 =~ y1 + y2 + y3 + y4
     dem65 =~ y5 + y6 + y7 + y8
   # regressions
     dem60 ~ ind60
     dem65 ~ ind60 + dem60
   # residual covariances
     y1 ~~ y5
     y2 ~~ y4 + y6
     y3 ~~ y7
     y4 ~~ y8
     y6 ~~ y8
'
fit <- sem(model, data = PoliticalDemocracy)
summary(fit)

More information can be found on the website: https://lavaan.org

Copy Link

Version

Install

install.packages('lavaan')

Monthly Downloads

67,615

Version

0.6-16

License

GPL (>= 2)

Maintainer

Last Published

July 19th, 2023

Functions in lavaan (0.6-16)

lavCor

Polychoric, polyserial and Pearson correlations
lavExport

lavaan Export
lavListInspect

Inspect or extract information from a lavaanList object
lavInspect

Inspect or extract information from a fitted lavaan object
lavNames

lavaan Names
lavMatrixRepresentation

lavaan matrix representation
getCov

Utility Functions For Covariance Matrices
fitMeasures

Fit Measures for a Latent Variable Model
growth

Fit Growth Curve Models
inspectSampleCov

Observed Variable Correlation Matrix from a Model and Data
lavResiduals

Residuals
lavTablesFitCp

Pairwise maximum likelihood fit statistics
lavPredictY

Predict the values of y-variables given the values of x-variables
lavTestLRT

LRT test
lavTest

Test of exact fit
lavOptions

lavaan Options
parTable

Parameter Table
lavPredict

Predict the values of latent variables (and their indicators).
lavTestScore

Score test
lavTables

lavaan frequency tables
lavTestWald

Wald test
lav_data

lavaan data functions
lavaan-class

Class For Representing A (Fitted) Latent Variable Model
lav_matrix

Utility Functions: Matrices and Vectors
lavaan

Fit a Latent Variable Model
lav_func

Utility Functions: Gradient and Jacobian
lav_constraints

Utility Functions: Constraints
lav_partable

lavaan partable functions
lav_model

lavaan model functions
lav_samplestats

lavaan samplestats functions
mplus2lavaan

mplus to lavaan converter
sam

Fit Structural Equation Models using the SAM approach
lavaanList-class

Class For Representing A List of (Fitted) Latent Variable Models
mplus2lavaan.modelSyntax

Convert Mplus model syntax to lavaan
parameterEstimates

Parameter Estimates
sem

Fit Structural Equation Models
InformativeTesting methods

Methods for output InformativeTesting()
lavaanList

Fit List of Latent Variable Models
modificationIndices

Modification Indices
model.syntax

The Lavaan Model Syntax
varTable

Variable Table
simulateData

Simulate Data From a Lavaan Model Syntax
summary.efaList

Summarizing EFA Fits
standardizedSolution

Standardized Solution
bootstrapLavaan

Bootstrapping a Lavaan Model
InformativeTesting

Testing order/inequality Constrained Hypotheses in SEM
FacialBurns

Dataset for illustrating the InformativeTesting function.
cfa

Fit Confirmatory Factor Analysis Models
Demo.twolevel

Demo dataset for a illustrating a multilevel CFA.
HolzingerSwineford1939

Holzinger and Swineford Dataset (9 Variables)
Demo.growth

Demo dataset for a illustrating a linear growth model.
efa

Exploratory Factor Analysis
PoliticalDemocracy

Industrialization And Political Democracy Dataset
estfun

Extract Empirical Estimating Functions