blavCompare: Bayesian model comparisons.

Description Usage Arguments Details Value References Examples

View source: R/blav_compare.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

ecmerkle/blavaan documentation built on Jan. 26, 2020, 11:05 a.m.