plot.see_bayesfactor_models {see} | R Documentation |
Plot method for Bayes Factors for model comparison
Description
The plot()
method for the bayestestR::bayesfactor_models()
function.
These plots visualize the posterior probabilities of the compared models.
Usage
## S3 method for class 'see_bayesfactor_models'
plot(
x,
n_pies = c("one", "many"),
value = c("none", "BF", "probability"),
sort = FALSE,
log = FALSE,
prior_odds = NULL,
...
)
Arguments
x |
An object. |
n_pies |
Number of pies. |
value |
What value to display. |
sort |
The behavior of this argument depends on the plotting contexts.
|
log |
Logical that decides whether to display log-transformed Bayes factors. |
prior_odds |
An optional vector of prior odds for the models. See
|
... |
Arguments passed to or from other methods. |
Value
A ggplot2-object.
Examples
library(bayestestR)
library(see)
lm0 <- lm(qsec ~ 1, data = mtcars)
lm1 <- lm(qsec ~ drat, data = mtcars)
lm2 <- lm(qsec ~ wt, data = mtcars)
lm3 <- lm(qsec ~ drat + wt, data = mtcars)
result <- bayesfactor_models(lm1, lm2, lm3, denominator = lm0)
plot(result, n_pies = "one", value = "probability", sort = TRUE) +
scale_fill_pizza(reverse = TRUE)
plot(result, n_pies = "many", value = "BF", log = TRUE) +
scale_fill_pizza(reverse = FALSE)