View source: R/bridgesampling.R
| bf.brma | R Documentation |
Compute the Bayes factor comparing two brma models.
## S3 method for class 'brma'
bf(x1, x2, log = FALSE, ...)
## S3 method for class 'brma'
bayes_factor(x1, x2, log = FALSE, ...)
x1 |
a brma model object (numerator). |
x2 |
a brma model object (denominator). |
log |
logical; if |
... |
additional arguments (currently not used). |
Computes the Bayes factor in favor of the model x1 over the
model x2. The marginal likelihoods must first be computed using
add_marglik. Both models must be fitted to the same
outcome target/data, including outcome type and, when present, weights and
cluster identifiers.
A list of class "bf_default" with components:
bf: (scalar) value of the Bayes factor in favor of
x1 over x2.
log: Boolean indicating whether bf corresponds
to the log Bayes factor.
add_marglik, bridge_sampler.brma,
post_prob.brma, logml.brma
## Not run:
if (requireNamespace("metadat", quietly = TRUE)) {
data(dat.lehmann2018, package = "metadat")
fit1 <- brma(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")
fit2 <- brma(
yi = yi,
vi = vi,
data = dat.lehmann2018,
measure = "SMD",
prior_effect = FALSE
)
fit1 <- add_marglik(fit1)
fit2 <- add_marglik(fit2)
bf(fit1, fit2)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.