View source: R/meta_subgroups.R
| apa_subgroups | R Documentation |
Makes an APA-style table of a subgroup analysis of a meta-analysis fit
with metafor::rma(): the pooled estimate of each subgroup, followed by
the overall pooled estimate, with the test of subgroup differences in the
note.
apa_subgroups(fit, subgroup, tau2 = c("separate", "common"), transform = TRUE)
fit |
a meta-analysis without moderators fit with |
subgroup |
the subgroup variable: the name of a column in the data of
|
tau2 |
|
transform |
if |
With tau2 = "separate" (default), each subgroup is pooled with its own
random-effects model (with the estimator of \tau^2 of fit),
and the subgroup estimates are compared with Q_{\text{between}}, the heterogeneity statistic of an equal-effects meta-analysis of
the subgroup estimates. With tau2 = "common", the subgroups share one
\tau^2: the estimates come from a mixed-effects
meta-regression with the subgroup as a categorical moderator, and the
subgroups are compared with the omnibus test of the moderator
(Q_{\text{M}}). The separate approach suits subgroups that may
differ in heterogeneity; the common approach gives more stable estimates
of \tau^2 when subgroups have few studies (Borenstein et al.,
2009, chap. 19).
Estimates are shown on the same scale as in apa_parameters() (e.g., risk
ratios are exponentiated, and Fisher's z values are converted back to
correlations).
apa7_tbl (tibble)
Borenstein, M., Hedges, L. V., Higgins, J. P. T., & Rothstein, H. R. (2009). Introduction to meta-analysis. Wiley. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/9780470743386")}
if (requireNamespace("metafor", quietly = TRUE) &&
requireNamespace("metadat", quietly = TRUE)) {
d_bcg <- metafor::escalc(
measure = "RR",
ai = tpos, bi = tneg, ci = cpos, di = cneg,
data = metadat::dat.bcg
)
fit_meta <- metafor::rma(yi, vi, data = d_bcg)
apa_subgroups(fit_meta, alloc)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.