# Example: BIC Bayes factor (approx.)
# Run the analysis
lm1 <- lm(Fertility ~ ., data = swiss)
lm2 <- update(lm1, . ~ . - Examination)
BF10 <- 1 / exp((BIC(lm2) - BIC(lm1)) / 2)
# Create the custom statistics
BIC_BFs <- custom_stats(
method = "BIC Bayes factor",
statistics = c(
custom_stat(name = "BF", value = BF10, subscript = "10"),
custom_stat(name = "BF", value = 1 / BF10, subscript = "01")
)
)
# Create an empty list
statistics <- list()
# Add the custom statistics to the list
statistics <- add_stats(statistics, BIC_BFs)
Run the code above in your browser using DataLab