View source: R/leave_one_out.R
leave_one_out | R Documentation |
Performs a leave-one-out analysis on a meta-analytic model from the **metafor** package by iteratively removing each level of a grouping variable and refitting the model.
leave_one_out(
model,
group,
vcalc_args = NULL,
robust_args = NULL,
phylo_args = NULL
)
model |
A meta-analytic model fitted using **metafor** package functions such as rma.mv(). |
group |
A character string specifying the column name in model$data that contains the grouping variable for which levels will be iteratively removed. |
vcalc_args |
Optional list of arguments for variance-covariance calculation using metafor's vcalc function. Must include:
|
robust_args |
Optional list of arguments for robust variance estimation using metafor's robust function. Must include:
|
phylo_args |
Optional list of arguments for phylogenetic matrix calculation using ape's vcv function. Must include:
|
An object of class "orchard" containing:
mod_table
: A data frame with model estimates from each leave-one-out iteration,
with an additional column indicating which group was omitted.
data
: A data frame with effect sizes from each iteration, with an additional
column indicating which group was omitted.
orig_mod_results
: The results from the original model without any omissions,
as returned by mod_results().
Facundo Decunta - fdecunta@agro.uba.ar
## Not run:
res <- metafor::rma.mv(lnrr, lnrr_vi, random = ~ 1 | paper_ID, data = fish)
loo_results <- leave_one_out(res, group = "paper_ID")
# With variance-covariance calculation
loo_results <- leave_one_out(res, group = "paper_ID",
vcalc_args = list(vi = "lnrr_vi",
cluster = "paper_ID",
obs = "es_ID",
rho = 0.5))
# With robust variance estimation
loo_results <- leave_one_out(res, group = "paper_ID",
robust_args = list(cluster = "paper_ID"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.