methods.anova.rma: Methods for 'anova.rma' Objects

methods.anova.rmaR Documentation

Methods for 'anova.rma' Objects

Description

Methods for objects of class "anova.rma" and "list.anova.rma".

Usage

## S3 method for class 'anova.rma'
as.data.frame(x, ...)
## S3 method for class 'list.anova.rma'
as.data.frame(x, ...)

Arguments

x

an object of class "anova.rma" or "list.anova.rma".

...

other arguments.

Author(s)

Wolfgang Viechtbauer wvb@metafor-project.org https://www.metafor-project.org

References

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. ⁠https://doi.org/10.18637/jss.v036.i03⁠

Examples

### copy data into 'dat'
dat <- dat.bcg

### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat)

### fit mixed-effects meta-regression model
res <- rma(yi, vi, mods = ~ alloc + ablat, data=dat)

### test the allocation factor
sav <- anova(res, btt="alloc")
sav

### turn object into a regular data frame
as.data.frame(sav)

### test the contrast between levels random and systematic
sav <- anova(res, X=c(0,1,-1,0))
sav

### turn object into a regular data frame
as.data.frame(sav)

### fit random-effects model
res0 <- rma(yi, vi, data=dat)

### LRT comparing the two models
sav <- anova(res, res0, refit=TRUE)
sav

### turn object into a regular data frame
as.data.frame(sav)

metafor documentation built on May 29, 2024, 7:44 a.m.