Learn R Programming

meta (version 3.0-1)

metareg: Meta-regression

Description

Meta-regression for objects of class meta. This is a wrapper function for the R function rma.uni in the R package metafor (Viechtbauer 2010).

Usage

metareg(x, formula, method.tau=x$method.tau, ...)

Arguments

x
An object of class meta.
formula
A formula object.
method.tau
A character string indicating which method is used to estimate the between-study variance tau-squared. Either "DL", "REML", "ML", "HS", "SJ", "HE", or "EB"
...
Additional arguments (ignored at the moment).

Value

  • An object of class c("rma.uni","rma"). Please look at the help page of R function rma.uni for more details.

Details

This R function is a wrapper function for R function rma.uni in the R package metafor (Viechtbauer 2010), i.e. the function metareg can only be used if the R package metafor is installed.

References

Viechtbauer W (2010), Conducting Meta-Analyses in R with the Metafor Package. Journal of Statistical Software, 36, 1--48.

See Also

summary.meta, metagen

Examples

Run this code
data(Fleiss93cont)

## Add some (fictious) grouping variables:
Fleiss93cont$age <- c(55, 65, 55, 65, 55)
Fleiss93cont$region <- c("Europe", "Europe", "Asia",
                         "Asia", "Europe")

meta1 <- metacont(n.e, mean.e, sd.e,
                  n.c, mean.c, sd.c,
                  data=Fleiss93cont, sm="MD")


mu1 <- update(meta1, byvar=region)

mu2 <- update(meta1, byvar=region,
              tau.common=TRUE, comb.fixed=FALSE)

## Warnings due to wrong ordering of arguments (order has changed with
## version 3.0-0 of R package meta)
##
##metareg(~region, meta1)
##metareg(~region, data=meta1)

## Warning as no information on covariate is available
##
##metareg(meta1)

## Do meta-regression for covariate region
## (see R code to create object mu2)
##
metareg(mu2)

## Same result for
## - tau-squared
## - test of heterogeneity
## - test for subgroup differences
## (as argument 'tau.common' was used to create mu2)
##
mu2
metareg(mu2)
metareg(meta1, ~region)
##
## Different result for
## - tau-squared
## - test of heterogeneity
## - test for subgroup differences
## (as argument 'tau.common' is - by default - FALSE)
##
mu1

## Do meta-regression with two covariates
##
metareg(mu1, ~region + age)

Run the code above in your browser using DataLab