What is blavaan?

The blavaan package is intended to provide researchers with an open, flexible, accessible set of tools for estimating Bayesian structural equation models. It uses model specification and helper functionality from R package lavaan, MCMC samplers from JAGS, and MCMC tools (including parallelization) from R package runjags.

The official reference to the blavaan package, which includes specific details on the package and the underlying modeling procedure, is:


As shown below, model estimation in blavaan is nearly identical to model estimation in lavaan. Default prior distributions are used below, and these priors can be modified as desired (see the examples for more detail).

  model <- ' 
    # latent variable definitions
    ind60 =~ x1 + x2 + x3
    dem60 =~ y1 + a*y2 + b*y3 + c*y4
    dem65 =~ y5 + a*y6 + b*y7 + c*y8
    # regressions
    dem60 ~ ind60
    dem65 ~ ind60 + dem60
    # residual correlations
    y1 ~~ y5
    y2 ~~ y4 + y6
    y3 ~~ y7
    y4 ~~ y8
    y6 ~~ y8
  fit <- bsem(model, data=PoliticalDemocracy)


blavaan is partially supported by National Science Foundation (NSF) grants SES-1061334 and 1460719. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.

Website created using R Markdown. Content was strongly influenced by the lavaan website.