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

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

Arguments

object

an object of class "rma".

...

other arguments.

Value

The model matrix.

Author

Wolfgang Viechtbauer wvb@metafor-project.org https://www.metafor-project.org

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

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

### 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)
#>    intrcpt ablat year
#> 1        1    44 1948
#> 2        1    55 1949
#> 3        1    42 1960
#> 4        1    52 1977
#> 5        1    13 1973
#> 6        1    44 1953
#> 7        1    19 1973
#> 8        1    13 1980
#> 9        1    27 1968
#> 10       1    42 1961
#> 11       1    18 1974
#> 12       1    33 1969
#> 13       1    33 1976