Learn R Programming

modelbpp (version 0.1.6)

min_prior: Minimum Prior

Description

Find the minimum prior probability required to achieve the desired BIC posterior probability.

Usage

min_prior(bic, bpp_target, target_name = "original")

Value

A scalar. The required prior probability.

Arguments

bic

A named vector of BIC values for a set of models.

bpp_target

A value from zero to 1. The desired BIC posterior probability.

target_name

The name of the original model, as appeared in the names of bic.

Details

It assumes that all models other than the original model have the same prior probabilities.

This function is called by model_set() or print.model_set() and usually users do not need to call it. It is exported for advanced users.

References

Wu, H., Cheung, S. F., & Leung, S. O. (2020). Simple use of BIC to assess model selection uncertainty: An illustration using mediation and moderation models. Multivariate Behavioral Research, 55(1), 1--16. tools:::Rd_expr_doi("10.1080/00273171.2019.1574546")

See Also

model_set() and print.model_set()

Examples

Run this code

library(lavaan)

dat <- dat_path_model

mod <-
"
x3 ~ a*x1 + b*x2
x4 ~ a*x1
ab := a*b
"

fit <- sem(mod, dat_path_model, fixed.x = TRUE)

out <- model_set(fit)
min_prior(out$bic, bpp_target = .8)

Run the code above in your browser using DataLab