View source: R/marginal_means.R
| marginal_means.brma | R Documentation |
Computes estimated marginal means for a fitted brma
object with moderators using BayesTools::as_marginal_inference().
## S3 method for class 'brma'
marginal_means(
object,
null_hypothesis = 0,
normal_approximation = FALSE,
n_samples = 10000,
output_measure = NULL,
transform = NULL,
bf = NULL,
...
)
object |
a fitted |
null_hypothesis |
point null hypothesis used for inclusion Bayes
factors. Defaults to |
normal_approximation |
whether prior and posterior density at the null
should be approximated with a normal distribution. Defaults to |
n_samples |
number of samples/grid points used by BayesTools for
marginal prior densities. Defaults to |
output_measure |
effect-size measure for location/effect predictions.
Defaults to the fitted measure. Supported conversions are among |
transform |
optional display transformation. Currently |
bf |
whether inclusion Bayes factors should be shown by default in
summaries. Defaults to |
... |
additional arguments (currently ignored). |
A list of class marginal_means.brma containing the
BayesTools marginal_inference object and parameter metadata.
summary(), plot(), summary.brma(), regplot()
## Not run:
if (requireNamespace("metadat", quietly = TRUE) &&
requireNamespace("metafor", quietly = TRUE)) {
data(dat.bcg, package = "metadat")
dat <- metafor::escalc(
measure = "RR",
ai = tpos,
bi = tneg,
ci = cpos,
di = cneg,
data = dat.bcg
)
fit <- brma(yi = yi, vi = vi, mods = ~ alloc, data = dat, measure = "RR")
mm <- marginal_means(fit)
summary(mm)
plot(mm, parameter = "alloc")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.