
Making expression for random-effects meta-analysis
expr_meta_random(
data,
type = "parametric",
metaBMA.args = list(),
random = "mixture",
k = 2L,
conf.level = 0.95,
caption = NULL,
output = "expression",
...
)
A dataframe. It must contain columns named estimate
(effect
sizes or outcomes) and std.error
(corresponding standard errors). These
two columns will be used for yi
and sei
arguments in metafor::rma
(for parametric analysis) or metaplus::metaplus
(for robust analysis).
Type of statistic expected ("parametric"
or "nonparametric"
or "robust"
or "bayes"
).Corresponding abbreviations are also accepted:
"p"
(for parametric), "np"
(nonparametric), "r"
(robust), or
"bf"
resp.
A list of additional arguments to be passed to
metaBMA::meta_random
.
The type of random effects distribution. One of "normal","t-dist","mixture", for standard normal,
Number of digits after decimal point (should be an integer)
(Default: k = 2L
).
Scalar between 0 and 1. If unspecified, the defaults return
95%
confidence/credible intervals (0.95
).
Text to display as caption. This argument is relevant only
when output = "caption"
.
If "expression"
, will return expression with statistical
details, while "dataframe"
will return a dataframe containing the
results.
Additional arguments passed to the respective meta-analysis function.
This analysis is carried out using-
parametric: metafor::rma
robust: metaplus::metaplus
Bayesian: metaBMA::meta_random
# NOT RUN {
# setup
set.seed(123)
library(statsExpressions)
library(metaplus)
# renaming to what `statsExpressions` expects
df <- dplyr::rename(mag, estimate = yi, std.error = sei)
# ----------------------- parametric ---------------------------------------
# creating expression
expr_meta_random(data = df, k = 3)
# ----------------------- random -----------------------------------------
# creating expression
expr_meta_random(
data = df,
type = "random",
random = "normal",
output = "dataframe"
)
# ----------------------- Bayes Factor -----------------------------------
# making subtitle
expr_meta_random(
data = df,
type = "bayes",
k = 3,
# additional arguments given to `metaBMA`
metaBMA.args = list(
iter = 5000,
summarize = "integrate",
control = list(adapt_delta = 0.99, max_treedepth = 15)
)
)
# }
Run the code above in your browser using DataLab