blavCompare: Bayesian model comparisons

View source: R/blav_compare.R

blavCompareR Documentation

Bayesian model comparisons

Description

Bayesian model comparisons, including WAIC, LOO, and Bayes factor approximation.

Usage

blavCompare(object1, object2, ...)

Arguments

object1

An object of class blavaan.

object2

A second object of class blavaan.

...

Other arguments (unused for now).

Details

This function approximates the log-Bayes factor of two candidate models using the Laplace approximation to each model's marginal log-likelihood.

Value

The log-Bayes factor approximation, along with each model's approximate marginal log-likelihood.

References

Raftery, A. E. (1993). Bayesian model selection in structural equation models. In K. A. Bollen & J. S. Long (Eds.), Testing structural equation models (pp. 163-180). Beverly Hills, CA: Sage.

Examples

## Not run: 
hsm1 <- ' visual  =~ x1 + x2 + x3 + x4
          textual =~ x4 + x5 + x6
          speed   =~ x7 + x8 + x9 '

fit1 <- bcfa(hsm1, data=HolzingerSwineford1939)

hsm2 <- ' visual  =~ x1 + x2 + x3
          textual =~ x4 + x5 + x6 + x7
          speed   =~ x7 + x8 + x9 '

fit2 <- bcfa(hsm2, data=HolzingerSwineford1939)

blavCompare(fit1, fit2)

## End(Not run)

blavaan documentation built on Sept. 26, 2023, 1:09 a.m.