Learn R Programming

metafor (version 1.4-0)

hatvalues.rma.uni: Diagonal Elements of the Hat Matrix for rma.uni Objects

Description

The function extracts the diagonal elements of the hat matrix for objects of class "rma.uni".

Usage

## S3 method for class 'rma.uni':
hatvalues(model, \dots)

Arguments

model
an object of class "rma.uni".
...
other arguments.

Value

  • A vector with the diagonal elements of the hat matrix.

References

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. (in press). Outlier and influence diagnostics for meta-analysis. Research Synthesis Methods.

See Also

rma.uni, influence.rma.uni

Examples

Run this code
### load BCG vaccine data
data(dat.bcg)

### meta-analysis of the log relative risks using a mixed-effects model
### with two moderators (absolute latitude and publication year)
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, mods=cbind(ablat, year),
           data=dat.bcg, measure="RR", method="REML")
hatvalues(res)

Run the code above in your browser using DataLab