Calculation of an overall mean from studies reporting a single mean using the inverse variance method for pooling; inverse variance weighting is used for pooling.
metamean(
n,
mean,
sd,
studlab,
data = NULL,
subset = NULL,
exclude = NULL,
cluster = NULL,
median,
q1,
q3,
min,
max,
method.mean = "Luo",
method.sd = "Shi",
approx.mean,
approx.sd,
sm = gs("smmean"),
method.ci = gs("method.ci.cont"),
level = gs("level"),
common = gs("common"),
random = gs("random") | !is.null(tau.preset),
overall = common | random,
overall.hetstat = common | random,
prediction = gs("prediction") | !missing(method.predict),
method.tau = gs("method.tau"),
method.tau.ci = gs("method.tau.ci"),
tau.preset = NULL,
TE.tau = NULL,
tau.common = gs("tau.common"),
level.ma = gs("level.ma"),
method.random.ci = gs("method.random.ci"),
adhoc.hakn.ci = gs("adhoc.hakn.ci"),
level.predict = gs("level.predict"),
method.predict = gs("method.predict"),
adhoc.hakn.pi = gs("adhoc.hakn.pi"),
null.effect = NA,
method.bias = gs("method.bias"),
backtransf = gs("backtransf"),
text.common = gs("text.common"),
text.random = gs("text.random"),
text.predict = gs("text.predict"),
text.w.common = gs("text.w.common"),
text.w.random = gs("text.w.random"),
title = gs("title"),
complab = gs("complab"),
outclab = "",
subgroup,
subgroup.name = NULL,
print.subgroup.name = gs("print.subgroup.name"),
sep.subgroup = gs("sep.subgroup"),
test.subgroup = gs("test.subgroup"),
prediction.subgroup = gs("prediction.subgroup"),
byvar,
adhoc.hakn,
keepdata = gs("keepdata"),
warn = gs("warn"),
warn.deprecated = gs("warn.deprecated"),
control = NULL,
...
)
An object of class c("metamean", "meta")
with corresponding
generic functions (see meta-object
).
Number of observations.
Estimated mean.
Standard deviation.
An optional vector with study labels.
An optional data frame containing the study information.
An optional vector specifying a subset of studies to be used.
An optional vector specifying studies to exclude from meta-analysis, however, to include in printouts and forest plots.
An optional vector specifying which estimates come from the same cluster resulting in the use of a three-level meta-analysis model.
Median (used to estimate the mean and standard deviation).
First quartile (used to estimate the mean and standard deviation).
Third quartile (used to estimate the mean and standard deviation).
Minimum (used to estimate the mean and standard deviation).
Maximum (used to estimate the mean and standard deviation).
A character string indicating which method to use to approximate the mean from the median and other statistics (see Details).
A character string indicating which method to use to approximate the standard deviation from sample size, median, interquartile range and range (see Details).
Approximation method to estimate means (see Details).
Approximation method to estimate standard deviations (see Details).
A character string indicating which summary measure
("MRAW"
or "MLN"
) is to be used for pooling of
studies.
A character string indicating which method is used to calculate confidence intervals for individual studies, see Details.
The level used to calculate confidence intervals for individual studies.
A logical indicating whether a common effect meta-analysis should be conducted.
A logical indicating whether a random effects meta-analysis should be conducted.
A logical indicating whether overall summaries should be reported. This argument is useful in a meta-analysis with subgroups if overall results should not be reported.
A logical value indicating whether to print heterogeneity measures for overall treatment comparisons. This argument is useful in a meta-analysis with subgroups if heterogeneity statistics should only be printed on subgroup level.
A logical indicating whether a prediction interval should be printed.
A character string indicating which method is
used to estimate the between-study variance \(\tau^2\) and its
square root \(\tau\) (see meta-package
).
A character string indicating which method is
used to estimate the confidence interval of \(\tau^2\) and
\(\tau\) (see meta-package
).
Prespecified value for the square root of the between-study variance \(\tau^2\).
Overall treatment effect used to estimate the between-study variance tau-squared.
A logical indicating whether tau-squared should be the same across subgroups.
The level used to calculate confidence intervals for meta-analysis estimates.
A character string indicating which method
is used to calculate confidence interval and test statistic for
random effects estimate (see meta-package
).
A character string indicating whether an
ad hoc variance correction should be applied in the case
of an arbitrarily small Hartung-Knapp variance estimate (see
meta-package
).
The level used to calculate prediction interval for a new study.
A character string indicating which method is
used to calculate a prediction interval (see
meta-package
).
A character string indicating whether an
ad hoc variance correction should be applied for
prediction interval (see meta-package
).
A numeric value specifying the effect under the null hypothesis.
A character string indicating which test is to
be used. Either "Begg"
, "Egger"
, or
"Thompson"
, can be abbreviated. See function
metabias
.
A logical indicating whether results should be
back transformed in printouts and plots for sm = "MLN"
. If
TRUE (default), results will be presented as means; otherwise
logarithm of means will be shown.
A character string used in printouts and forest plot to label the pooled common effect estimate.
A character string used in printouts and forest plot to label the pooled random effects estimate.
A character string used in printouts and forest plot to label the prediction interval.
A character string used to label weights of common effect model.
A character string used to label weights of random effects model.
Title of meta-analysis / systematic review.
Comparison label.
Outcome label.
An optional vector to conduct a meta-analysis with subgroups.
A character string with a name for the subgroup variable.
A logical indicating whether the name of the subgroup variable should be printed in front of the group labels.
A character string defining the separator between name of subgroup variable and subgroup label.
A logical value indicating whether to print results of test for subgroup differences.
A logical indicating whether prediction intervals should be printed for subgroups.
Deprecated argument (replaced by 'subgroup').
Deprecated argument (replaced by 'adhoc.hakn.ci').
A logical indicating whether original data (set) should be kept in meta object.
A logical indicating whether warnings should be printed (e.g., if studies are excluded from meta-analysis due to zero standard deviations).
A logical indicating whether warnings should be printed if deprecated arguments are used.
An optional list to control the iterative process to
estimate the between-study variance \(\tau^2\). This argument
is passed on to rma.uni
.
Additional arguments (to catch deprecated arguments).
Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de
Common effect and random effects meta-analysis of single means to
calculate an overall mean; inverse variance weighting is used for
pooling. Note, you should use R function metacont
to
compare means of pairwise comparisons instead of using
metamean
for each treatment arm separately which will break
randomisation in randomised controlled trials.
A three-level random effects meta-analysis model (Van den Noortgate
et al., 2013) is utilized if argument cluster
is used and at
least one cluster provides more than one estimate. Internally,
rma.mv
is called to conduct the analysis and
weights.rma.mv
with argument type =
"rowsum"
is used to calculate random effects weights.
Default settings are utilised for several arguments (assignments
using gs
function). These defaults can be changed for
the current R session using the settings.meta
function.
Furthermore, R function update.meta
can be used to
rerun a meta-analysis with different settings.
The following transformations of means are implemented to calculate an overall mean:
Raw, i.e. untransformed, means (sm = "MRAW"
, default)
Log transformed means (sm = "MLN"
)
Calculations are conducted on the log scale if sm =
"ROM"
. Accordingly, list elements TE
, TE.common
, and
TE.random
contain the logarithm of means. In printouts and
plots these values are back transformed if argument
backtransf = TRUE
(default).
Missing means can be derived from
sample size, median, interquartile range and range (arguments
n
, median
, q1
, q3
, min
, and
max
),
sample size, median and interquartile range (arguments
n
, median
, q1
, and q3
), or
sample size, median and range (arguments n
,
median
, min
, and max
).
By default, methods described in Luo et al. (2018) are utilized
(argument method.mean = "Luo"
):
equation (15) if sample size, median, interquartile range and range are available,
equation (11) if sample size, median and interquartile range are available,
equation (7) if sample size, median and range are available.
Instead the methods described in Wan et al. (2014) are used if
argument method.mean = "Wan"
:
equation (10) if sample size, median, interquartile range and range are available,
equation (14) if sample size, median and interquartile range are available,
equation (2) if sample size, median and range are available.
The following methods are also available to estimate means from quantiles or ranges if R package estmeansd is installed:
Method for Unknown Non-Normal Distributions (MLN) approach
(Cai et al. (2021), argument method.mean = "Cai"
),
Quantile Estimation (QE) method (McGrath et al. (2020),
argument method.mean = "QE-McGrath"
)),
Box-Cox (BC) method (McGrath et al. (2020),
argument method.mean = "BC-McGrath"
)).
By default, missing means are replaced successively using
interquartile ranges and ranges (if available), interquartile
ranges (if available) and finally ranges. Argument
approx.mean
can be used to overwrite this behaviour for each
individual study and treatment arm:
use means directly (entry ""
in argument
approx.mean
);
median, interquartile range and range ("iqr.range"
);
median and interquartile range ("iqr"
);
median and range ("range"
).
Missing standard deviations can be derived from
sample size, median, interquartile range and range (arguments
n
, median
, q1
, q3
, min
, and
max
),
sample size, median and interquartile range (arguments
n
, median
, q1
and q3
), or
sample size, median and range (arguments n
,
median
, min
and max
).
Wan et al. (2014) describe methods to estimate the standard
deviation from the sample size, median and additional
statistics. Shi et al. (2020) provide an improved estimate of the
standard deviation if the interquartile range and range are
available in addition to the sample size and median. Accordingly,
equation (11) in Shi et al. (2020) is the default (argument
method.sd = "Shi"
), if the median, interquartile range and
range are provided. The method by Wan et al. (2014) is used if
argument method.sd = "Wan"
and, depending on the sample
size, either equation (12) or (13) is used. If only the
interquartile range or range is available, equations (15) / (16)
and (7) / (9) in Wan et al. (2014) are used, respectively.
The following methods are also available to estimate standard deviations from quantiles or ranges if R package estmeansd is installed:
Method for Unknown Non-Normal Distributions (MLN) approach
(Cai et al. (2021), argument method.mean = "Cai"
),
Quantile Estimation (QE) method (McGrath et al. (2020),
argument method.mean = "QE-McGrath"
)),
Box-Cox (BC) method (McGrath et al. (2020),
argument method.mean = "BC-McGrath"
)).
By default, missing standard deviations are replaced successively
using these method, i.e., interquartile ranges and ranges are used
before interquartile ranges before ranges. Argument
approx.sd
can be used to overwrite this default for each
individual study and treatment arms:
sample size, median, interquartile range and range
("iqr.range"
);
sample size, median and interquartile range ("iqr"
);
sample size, median and range ("range"
).
For untransformed means (argument sm = "MRAW"
), the
confidence interval for individual studies can be based on the
standard normal distribution (method.ci = "z"
, default), or
t-distribution (method.ci = "t"
).
Argument subgroup
can be used to conduct subgroup analysis for
a categorical covariate. The metareg
function can be
used instead for more than one categorical covariate or continuous
covariates.
Arguments subset
and exclude
can be used to exclude
studies from the meta-analysis. Studies are removed completely from
the meta-analysis using argument subset
, while excluded
studies are shown in printouts and forest plots using argument
exclude
(see Examples in metagen
).
Meta-analysis results are the same for both arguments.
Internally, both common effect and random effects models are
calculated regardless of values choosen for arguments
common
and random
. Accordingly, the estimate
for the random effects model can be extracted from component
TE.random
of an object of class "meta"
even if
argument random = FALSE
. However, all functions in R
package meta will adequately consider the values for
common
and random
. E.g. functions
print.meta
and forest.meta
will not
print results for the random effects model if random =
FALSE
.
A prediction interval will only be shown if prediction =
TRUE
.
Cai S, Zhou J, Pan J (2021): Estimating the sample mean and standard deviation from order statistics and sample size in meta-analysis. Statistical Methods in Medical Research, 30, 2701--2719
Luo D, Wan X, Liu J, Tong T (2018): Optimally estimating the sample mean from the sample size, median, mid-range, and/or mid-quartile range. Statistical Methods in Medical Research, 27, 1785--805
McGrath S, Zhao X, Steele R, et al. and the DEPRESsion Screening Data (DEPRESSD) Collaboration (2020): Estimating the sample mean and standard deviation from commonly reported quantiles in meta-analysis. Statistical Methods in Medical Research, 29, 2520--2537
Shi J, Luo D, Weng H, Zeng X-T, Lin L, Chu H, et al. (2020): Optimally estimating the sample standard deviation from the five-number summary. Research Synthesis Methods.
Van den Noortgate W, López-López JA, Marín-Martínez F, Sánchez-Meca J (2013): Three-level meta-analysis of dependent effect sizes. Behavior Research Methods, 45, 576--94
Wan X, Wang W, Liu J, Tong T (2014): Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology, 14, 135
meta-package
, update.meta
,
metamean
, metagen
m1 <- metamean(rep(100, 3), 1:3, rep(1, 3))
m1
m2 <- update(m1, sm = "MLN")
m2
# With test for overall mean equal to 2
#
update(m1, null.effect = 2)
update(m2, null.effect = 2)
# Print results without back-transformation
#
update(m1, backtransf = FALSE)
update(m2, backtransf = FALSE)
update(m1, null.effect = 2, backtransf = FALSE)
update(m2, null.effect = 2, backtransf = FALSE)
Run the code above in your browser using DataLab