# blavaan 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): ``` r 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.](https://ecmerkle.r-universe.dev/blavaan) ``` r 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](https://doi.org/10.18637/jss.v100.i06). Journal of Statistical Software, 100(6), 1–22. Merkle, E. C., & Rosseel, Y. (2018). [blavaan: Bayesian structural equation models via parameter expansion](https://doi.org/10.18637/jss.v085.i04). 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. # Package index ## All functions - [`bcfa()`](https://blavaan.org/reference/bcfa.md) : Fit Confirmatory Factor Analysis Models - [`bgrowth()`](https://blavaan.org/reference/bgrowth.md) : Fit Growth Curve Models - [`blavCompare()`](https://blavaan.org/reference/blavCompare.md) : Bayesian model comparisons - [`blavFitIndices()`](https://blavaan.org/reference/blavFitIndices.md) [`summary(`*``*`)`](https://blavaan.org/reference/blavFitIndices.md) [`summary(`*``*`)`](https://blavaan.org/reference/blavFitIndices.md) : SEM Fit Indices for Bayesian SEM - [`blavInspect()`](https://blavaan.org/reference/blavInspect.md) [`blavTech()`](https://blavaan.org/reference/blavInspect.md) : Inspect or Extract Information from a Fitted blavaan Object - [`blavPredict()`](https://blavaan.org/reference/blavPredict.md) : Predict the values of latent variables, observed variables, and missing variables. - [`blav_internal`](https://blavaan.org/reference/blav_internal.md) [`blav_model_test`](https://blavaan.org/reference/blav_internal.md) [`coeffun`](https://blavaan.org/reference/blav_internal.md) [`set_phantoms`](https://blavaan.org/reference/blav_internal.md) [`set_inits`](https://blavaan.org/reference/blav_internal.md) [`set_priors`](https://blavaan.org/reference/blav_internal.md) [`labelfun`](https://blavaan.org/reference/blav_internal.md) : blavaan internal functions - [`blavaan-class`](https://blavaan.org/reference/blavaan-class.md) [`coef,blavaan-method`](https://blavaan.org/reference/blavaan-class.md) [`show,blavaan-method`](https://blavaan.org/reference/blavaan-class.md) [`predict,blavaan-method`](https://blavaan.org/reference/blavaan-class.md) [`summary,blavaan-method`](https://blavaan.org/reference/blavaan-class.md) : Class For Representing A (Fitted) Bayesian Latent Variable Model - [`blavaan()`](https://blavaan.org/reference/blavaan.md) : Fit a Bayesian Latent Variable Model - [`bsem()`](https://blavaan.org/reference/bsem.md) : Fit Structural Equation Models - [`dpriors()`](https://blavaan.org/reference/dpriors.md) : Specify Default Prior Distributions - [`glance(`*``*`)`](https://blavaan.org/reference/glance.blavaan.md) : Glance at a blavaan object - [`plot(`*``*`)`](https://blavaan.org/reference/plot.blavaan.md) : blavaan Diagnostic Plots - [`ppmc()`](https://blavaan.org/reference/ppmc.md) [`summary(`*``*`)`](https://blavaan.org/reference/ppmc.md) [`summary(`*``*`)`](https://blavaan.org/reference/ppmc.md) [`plot(`*``*`)`](https://blavaan.org/reference/ppmc.md) [`hist(`*``*`)`](https://blavaan.org/reference/ppmc.md) [`pairs(`*``*`)`](https://blavaan.org/reference/ppmc.md) : Posterior Predictive Model Checks - [`sampleData()`](https://blavaan.org/reference/sampleData.md) : Sample data from the posterior (or prior) distribution. - [`standardizedPosterior()`](https://blavaan.org/reference/standardizedPosterior.md) : Standardized Posterior - [`tidy(`*``*`)`](https://blavaan.org/reference/tidy.blavaan.md) : Tidy a blavaan object # Articles ### All vignettes - [Approximate fit indices](https://blavaan.org/articles/approx_fi.md): - [Convergence and Efficiency Evaluation](https://blavaan.org/articles/convergence_efficiency.md): - [Convergence loop](https://blavaan.org/articles/convergence_loop.md): - [Cross-loadings with strong priors](https://blavaan.org/articles/cross_loadings_strong_priors.md): - [Model Estimation](https://blavaan.org/articles/estimate.md): - [Measurement Invariance](https://blavaan.org/articles/invariance.md): - [Modification indices](https://blavaan.org/articles/mod_indices.md): - [Model Comparison](https://blavaan.org/articles/model_comparison.md): - [Two-level SEM](https://blavaan.org/articles/multilevel.md): - [Ordinal Models in blavaan](https://blavaan.org/articles/ordinal.md): - [Plot Functionality](https://blavaan.org/articles/plotting.md): - [Prior Predictive Checks](https://blavaan.org/articles/prior_pred_checks.md): - [Specifying Prior Distributions](https://blavaan.org/articles/prior.md): - [Probability of Direction](https://blavaan.org/articles/probability_direction.md): - [Resources](https://blavaan.org/articles/resources.md): - [Getting Started with blavaan](https://blavaan.org/articles/start.md): - [Model Summaries](https://blavaan.org/articles/summaries.md):