metafor (version 4.4-0)

coef.rma: Extract the Model Coefficients and Coefficient Table from 'rma' and 'summary.rma' Objects

Description

Function to extract the estimated model coefficients from objects of class "rma". For objects of class "summary.rma", the model coefficients, corresponding standard errors, test statistics, p-values, and confidence interval bounds are extracted.

Usage

# S3 method for rma
coef(object, ...)
# S3 method for summary.rma
coef(object, ...)

Value

Either a vector with the estimated model coefficient(s) or a data frame with the following elements:

estimate

estimated model coefficient(s).

se

corresponding standard error(s).

zval

corresponding test statistic(s).

pval

corresponding p-value(s).

ci.lb

corresponding lower bound of the confidence interval(s).

ci.ub

corresponding upper bound of the confidence interval(s).

When the model was fitted with test="t" or test="knha", then zval is called tval in the data frame that is returned by the function.

Arguments

object

an object of class "rma" or "summary.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.mh, rma.peto, rma.glmm, and rma.mv for functions to fit models for which model coefficients/tables can be extracted.

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 model coefficients
coef(res)

### extract model coefficient table
coef(summary(res))

Run the code above in your browser using DataLab