Bayesian Latent Variable Analysis

Fit a variety of Bayesian latent variable models, including confirmatory factor analysis, structural equation models, and latent growth curve models. References: Merkle & Rosseel (2018) ; Merkle et al. (2021) .


blavaan

R build status

blavaan is a free, open source R package for Bayesian latent variable analysis. It relies on JAGS and Stan to estimate models via MCMC.

The blavaan functions and syntax are similar to lavaan. For example, consider the Political Democracy example from Bollen (1989):

library(lavaan) # for the PoliticalDemocracy data
library(blavaan)

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 <- bsem(model, data = PoliticalDemocracy)
summary(fit)

The development version of blavaan (containing updates not yet on CRAN) can be installed via the command below. Compilation is required; this may be a problem for users who currently rely on a binary version of blavaan from CRAN. A potential alternative is to install a binary from R-universe.

remotes::install_github("ecmerkle/blavaan", INSTALL_opts = "--no-multiarch")

For further information, see:

Merkle, E. C., Fitzsimmons, E., Uanhoro, J., & Goodrich, B. (2021). Efficient Bayesian structural equation modeling in Stan. Journal of Statistical Software, 100(6), 1–22.

Merkle, E. C., & Rosseel, Y. (2018). blavaan: Bayesian structural equation models via parameter expansion. Journal of Statistical Software, 85(4), 1–30.

blavaan has been supported by the Institute of Education Sciences, U.S. Department of Education, Grant R305D210044, as well as NSF grants SES-1061334 and 1460719.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("blavaan")

0.6-1 by Edgar Merkle, 2 months ago


https://blavaan.org, https://github.com/ecmerkle/blavaan


Report a bug at https://github.com/ecmerkle/blavaan/issues


Browse source code at https://github.com/cran/blavaan


Authors: Edgar Merkle [aut, cre] (ORCID: , Yves Rosseel [aut] , Ben Goodrich [aut] , Mauricio Garnier-Villarreal [ctb] (ORCID: , R/blav_compare.R , R/ctr_bayes_fit.R , vignettes) , Terrence D. Jorgensen [ctb] (ORCID: , R/ctr_bayes_fit.R , R/ctr_ppmc.R , R/blav_predict.R) , Huub Hoofs [ctb] (R/ctr_bayes_fit.R) , Rens van de Schoot [ctb] (R/ctr_bayes_fit.R) , Andrew Johnson [ctb] (Makevars) , Matthew Emery [ctb] (loo moment_match) , Michael S. Truong [ctb] (R/blav_tidiers.R , options(blavaan.target))


Documentation:   PDF Manual  


GPL (>= 3) license


Imports stats, utils, graphics, lavaan, coda, mnormt, nonnest2, loo, rstan, rstantools, RcppParallel, bayesplot, Matrix, future, future.apply, tmvnsim, igraph, generics

Depends on methods, Rcpp

Suggests runjags, modeest, rjags, cmdstanr, posterior, semTools, blavsam, tinytest

Linking to StanHeaders, rstan, BH, Rcpp, RcppEigen, RcppParallel

System requirements: GNU make


Imported by ggsem.

Depended on by brxx.

Suggested by INLAvaan, PsyMetricTools, bayestestR, insight, parameters, performance, rmedsem, semPlot, semTools, tidySEM.


See at CRAN