Model Updating for 'rma' Objects
The function can be used to update and (by default) re-fit "rma"
models. It does this by extracting the call stored in the object, updating the call and (by default) evaluating that call.
## S3 method for class 'rma' update(object, formula., ..., evaluate = TRUE)
object |
an object of class |
formula. |
changes to the formula. See ‘Details’. |
... |
additional arguments to the call, or arguments with changed values. |
evaluate |
logical indicating whether to evaluate the new call or just return the call. |
For objects of class "rma.uni"
, "rma.glmm"
, and "rma.mv"
, the formula.
argument can be used to update the set of moderators included in the model (see ‘Examples’).
If evaluate=TRUE
the fitted object, otherwise the updated call.
The present function is based on update.default
, with changes made by Wolfgang Viechtbauer (wvb@metafor-project.org) so that the formula updating works with the (somewhat non-standard) interface of the rma.uni
, rma.glmm
, and rma.mv
functions.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://www.jstatsoft.org/v036/i03.
### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg) ### random-effects model (method="REML" is default) res <- rma(yi, vi, data=dat, digits=3) res ### mixed-effects model with two moderators (absolute latitude and publication year) res <- update(res, ~ ablat + year) res ### remove 'year' moderator res <- update(res, ~ . - year) res ### fit model with ML estimation update(res, method="ML") ### example with rma.glmm() res <- rma.glmm(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, digits=3) res <- update(res, mods = ~ ablat) res ### conditional model with approximate likelihood update(res, model="CM.AL")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.