Learn R Programming

metafor (version 1.9-7)

model.matrix.rma: Model Matrix for 'rma' Objects

Description

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

Usage

## S3 method for class 'rma':
model.matrix(object, \dots)

Arguments

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

Value

  • The model 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/.

See Also

fitted.rma

Examples

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

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

Run the code above in your browser using DataLab