0

I am using the metafor package (documentation) to conduct meta analysis with mixed effects in R. I have noticed, however, that there are no studentized residuals available for the particular model object I'm using, rma.mv. I am wondering whether this is a "yet-to-be-implemented" feature or if there is a deeper statistical reason for not computing studentized residuals for this model that I'm not thinking of.

Here is a working example with mock-up data using (available below)

library(metafor)
fit.example <- rma.mv(yi, vi, mods = ~ leg - 1,
                                random = ~ leg | study,
                                data = fit.reg.example,
                                struct = "CS")

rstudent(fit.example)
residuals(fit.example, type = 'rstudent')  # Another attempt at same thing.

Here is the error:

Error in UseMethod("rstudent") : 
  no applicable method for 'rstudent' applied to an object of class "c('rma.mv', 'rma')"

I do think the comments on the top of page 200 seem to suggest rstudent is just not implemented for rma.mv. Does anyone have a suggestion about how I can go about efficiently implementing this on my own, or fitting existing R functions to this model object?

print(fit.reg.example)
   study leg          yi        vi     S.leg
1      1   C  1.80857563 0.4696227 0.8349112
2      1   B  0.59614768 0.3481413 0.9896877
3      1   D  1.94789714 0.4914293 0.8162649
4      1   E  5.69724562 1.6857753 0.7652821
5      1   F  4.80478218 1.2952472 0.7659036
6      1   G  4.89888935 1.3332965 0.8103878
7      1   H  3.41733531 0.8199242 0.7374167
8      3   C  0.39048716 0.5095300 0.8194892
9      3   B -0.02602006 0.5000423 1.5372757
10     3   D -0.27496234 0.5047253 0.9455840
11     3   E  1.13476584 0.5804808 1.5421684
12     3   F  0.35406352 0.5078351 1.4969065
13     3   G  0.95926876 0.5575123 1.4698696
14     3   H  0.46924378 0.5137619 0.7671918
15     5   C  1.23044148 0.5946241 0.7395719
16     5   B  0.97830991 0.5598181 0.7768499
17     5   D  0.26557617 0.5044082 0.6024637
18     5   E  4.20096851 1.6030085 0.6831758
19     5   F  4.36573445 1.6912273 0.5703508
20     5   G  3.90316892 1.4521705 0.5764547
RMurphy
  • 746
  • 5
  • 15
  • 1
    Many of the post-model-fitting functions in metafor are not available for rma.mv. If want to learn more (and are looking for solutions to check potential outliers [just a guess]), Wolfgang explains more in then answer here: https://stats.stackexchange.com/questions/155693/metafor-package-bias-and-sensitivity-diagnostics – jsakaluk Aug 06 '18 at 20:34

1 Answers1

1

If you install the "devel" version of metafor (see: https://github.com/wviechtb/metafor#installation), then rstudent() will work for rma.mv models.

See also:

https://wviechtb.github.io/metafor/news/index.html

for the changelog of the package.

Wolfgang
  • 15,542
  • 1
  • 47
  • 74