metafor (version 1.9-9)

vcov.rma: Extract the Variance-Covariance Matrix of the Parameter Estimates from 'rma' Objects

Description

The function extracts the (estimated) variance-covariance matrix of the (fixed effects) parameter estimates from objects of class "rma" or the marginal variance-covariance matrix of the observed effect sizes or outcomes.

Usage

"vcov"(object, type="fixed", ...)

Arguments

object
an object of class "rma".
type
character string indicating whether to return the variance-covariance matrix of the fixed effects (type="fixed") or the marginal variance-covariance matrix of the observed effect sizes or outcomes (type="obs").
...
other arguments.

Value

A matrix corresponding to the requested variance-covariance matrix.

Details

Note that type="obs" currently only works for object of class "rma.uni" and "rma.mv".

For objects of class "rma.uni", the marginal variance-covariance matrix is just a diagonal matrix with \tau² + vᵢ along the diagonal, where \tau² is the estimated amount of (residual) heterogeneity (set to 0 in fixed-effects models) and vᵢ is the sampling variance of the $i$th study.

For objects of class "rma.mv", the structure can be more complex and depends on the types of random effects included in the model.

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/.

See Also

rma.uni, rma.mh, rma.peto, rma.glmm, rma.mv

Examples

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

### marginal var-cov matrix of the observed log relative risks
vcov(res, type="obs")

Run the code above in your browser using DataLab