### 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
### studies with studentized residuals larger than +-1.96
sav[abs(sav$z) > 1.96,]
### variables specified are automatically searched for within the object itself
sav[abs(z) > 1.96,]
### note: this behavior is specific to 'rma.list' objects; this doesn't work for regular data frames
Run the code above in your browser using DataLab