Learn R Programming

meta (version 9.0-0)

as.data.frame.meta: Coerce to a data frame

Description

The as.data.frame method returns a data frame containing information on individual studies, e.g., estimated treatment effect and its standard error.

Usage

# S3 method for meta
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Value

A data frame is returned by the function as.data.frame.

Arguments

x

An object of class meta.

row.names

NULL or a character vector giving the row names for the data frame.

optional

Argument is ignored.

...

Other arguments (ignored).

Author

Guido Schwarzer [email protected]

See Also

metabin, metacont, metagen, forest.meta

Examples

Run this code
data(Fleiss1993cont)
#
# Generate additional variable with grouping information
#
Fleiss1993cont$group <- c(1, 2, 1, 1, 2)
#
# Do meta-analysis without grouping information
#
ma1 <- metacont(n.psyc, mean.psyc, sd.psyc, n.cont, mean.cont, sd.cont,
  data = Fleiss1993cont, sm = "SMD", studlab = paste(study, year))
#
# Update meta-analysis object and do subgroup analyses
#
update(ma1, subgroup = group)

# Same result using metacont function directly
#
ma2 <- metacont(n.psyc, mean.psyc, sd.psyc, n.cont, mean.cont, sd.cont,
  data = Fleiss1993cont, sm = "SMD", studlab = paste(study, year),
  subgroup = group)
ma2

# Compare printout of the following two commands
#
as.data.frame(ma1)
ma1$data

Run the code above in your browser using DataLab