metafor (version 3.8-1)

model.matrix.rma: Extract the Model Matrix from 'rma' Objects

Description

The function extracts the model matrix from objects of class "rma".

Usage

# S3 method for rma
model.matrix(object, ...)

Value

The model matrix.

Arguments

object

an object of class "rma".

...

other arguments.

References

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. https://doi.org/10.18637/jss.v036.i03

See Also

rma.uni, rma.glmm, and rma.mv for functions to fit models for which a model matrix can be extracted.

fitted.rma for a function to extract the fitted values.

Examples

Run this code
### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

### fit mixed-effects model with absolute latitude and publication year as moderators
res <- rma(yi, vi, mods = ~ ablat + year, data=dat)

### extract the model matrix
model.matrix(res)

Run the code above in your browser using DataLab