hatvalues.rma.mv {metafor}R Documentation

Outlier and Influential Case Diagnostics for 'rma.mv' Objects

Description

The functions compute various outlier and influential case diagnostics (some of which indicate the influence of deleting one case/study at a time on the model fit and the fitted/residual values) for objects of class "rma.mv". At the moment, only Cook's distances and hat values can be obtained.

Usage

## S3 method for class 'rma.mv'
cooks.distance(model, progbar=FALSE, ...)
## S3 method for class 'rma.mv'
hatvalues(model, type="diagonal", ...)

Arguments

model

an object of class "rma.mv".

progbar

logical indicating whether a progress bar should be shown (the default is FALSE).

type

character string indicating whether to return only the diagonal of the hat matrix ("diagonal") or the entire hat matrix ("matrix").

...

other arguments.

Details

Cook's distance can be interpreted as the Mahalanobis distance between the entire set of predicted values once with the ith study included and once with the ith study excluded from the model fitting.

Value

The cooks.distance function returns a vector. The hatvalues function returns either a vector with the diagonal elements of the hat matrix or the entire hat matrix.

Note

Right now, the leave-one-out diagnostics are calculated by refitting the model k times. Depending on how large k is, it may take a few moments to finish the calculations.

It may not be possible to fit the model after deletion of the ith study from the dataset. This will result in NA values for that study.

Author(s)

Wolfgang Viechtbauer wvb@metafor-project.org
package website: http://www.metafor-project.org/
author homepage: http://www.wvbauer.com/

References

Belsley, D. A., Kuh, E., & Welsch, R. E. (1980). Regression diagnostics. New York: Wiley.

Cook, R. D., & Weisberg, S. (1982). Residuals and influence in regression. London: Chapman and Hall.

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. http://www.jstatsoft.org/v36/i03/.

Viechtbauer, W., & Cheung, M. W.-L. (2010). Outlier and influence diagnostics for meta-analysis. Research Synthesis Methods, 1, 112–125.

Examples

### multilevel random-effects model
res <- rma.mv(yi, vi, random = ~ 1 | district/school, data=dat.konstantopoulos2011)
print(res, digits=3)

### Cook's distances
x <- cooks.distance(res)
x
plot(x, type="o", pch=19)

### hat values
hatvalues(res)

[Package metafor version 2.0-0 Index]