methods.list.rma.Rd
Methods for objects of class "list.rma"
.
# S3 method for class 'list.rma'
as.data.frame(x, ...)
# S3 method for class 'list.rma'
as.matrix(x, ...)
# S3 method for class 'list.rma'
x[i, ...]
# S3 method for class 'list.rma'
head(x, n=6L, ...)
# S3 method for class 'list.rma'
tail(x, n=6L, ...)
# S3 method for class 'list.rma'
x$name <- value
For the `[`
method, any variables specified as part of the i
argument will be searched for within object x
first (see ‘Examples’).
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
### copy data into 'dat' and examine data
dat <- dat.viechtbauer2021
### calculate log odds ratios and corresponding sampling variances
dat <- escalc(measure="OR", ai=xTi, n1i=nTi, ci=xCi, n2i=nCi, add=1/2, to="all", data=dat)
### fit mixed-effects meta-regression model
res <- rma(yi, vi, mods = ~ dose, data=dat)
### get studentized residuals
sav <- rstudent(res)
sav
#>
#> resid se z
#> 1 0.5344 0.4849 1.1021
#> 2 -0.3653 0.5163 -0.7076
#> 3 -0.0468 0.4815 -0.0972
#> 4 -0.3142 0.4177 -0.7522
#> 5 0.1743 0.4262 0.4089
#> 6 -0.9963 0.3195 -3.1187
#> 7 0.0250 0.3723 0.0672
#> 8 0.9197 0.7572 1.2147
#> 9 0.7779 0.3678 2.1149
#> 10 0.3078 0.4548 0.6768
#> 11 -0.2261 0.3995 -0.5661
#> 12 -0.2763 0.4113 -0.6718
#> 13 -0.6072 0.4468 -1.3590
#> 14 0.9350 0.7213 1.2964
#> 15 0.2894 0.4754 0.6087
#> 16 -0.1011 0.5738 -0.1762
#> 17 0.2310 0.6001 0.3849
#> 18 0.0103 0.4944 0.0207
#> 19 0.3425 0.3941 0.8690
#> 20 -0.3079 0.4618 -0.6667
#>
### studies with studentized residuals larger than +-1.96
sav[abs(sav$z) > 1.96,]
#>
#> resid se z
#> 6 -0.9963 0.3195 -3.1187
#> 9 0.7779 0.3678 2.1149
#>
### variables specified are automatically searched for within the object itself
sav[abs(z) > 1.96,]
#>
#> resid se z
#> 6 -0.9963 0.3195 -3.1187
#> 9 0.7779 0.3678 2.1149
#>
### note: this behavior is specific to 'rma.list' objects; this doesn't work for regular data frames