Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

blavCompare

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

Bayesian Latent Variable Analysis

v0.3-15
GPL (>= 3)
Authors
Edgar Merkle [aut, cre] (<https://orcid.org/0000-0001-7158-0653>), Yves Rosseel [aut], Ben Goodrich [aut], Mauricio Garnier-Villarreal [ctb] (<https://orcid.org/0000-0002-2951-6647>, R/blav_compare.R, R/ctr_bayes_fit.R), Terrence D. Jorgensen [ctb] (<https://orcid.org/0000-0001-5111-6773>, R/ctr_bayes_fit.R, R/ctr_ppmc.R), Huub Hoofs [ctb] (R/ctr_bayes_fit.R), Rens van de Schoot [ctb] (R/ctr_bayes_fit.R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.