Learn R Programming

orchaRd (version 2.2.1)

num_studies: num_studies

Description

Computes how many studies are in each level of categorical moderators of a rma.mv model object.

Usage

num_studies(data, mod, group)

Value

Returns a table with the number of studies in each level of all parameters within a rma.mv or rma object.

Arguments

data

Raw data from object of class "orchard"

mod

Character string describing the moderator of interest.

group

A character string specifying the column name of the study ID grouping variable.

Author

Shinichi Nakagawa - s.nakagawa@unsw.edu.au

Daniel Noble - daniel.noble@anu.edu.au

Examples

Run this code
# \donttest{
data(fish)
warm_dat <- fish
model <- metafor::rma.mv(
  yi = lnrr, V = lnrr_vi,
  random = list(~1 | es_ID, ~1 | group_ID),
  mods = ~ experimental_design - 1,
  method = "REML", test = "t", data = warm_dat,
  control = list(optimizer = "optim",
    optmethod = "Nelder-Mead"))
res <- mod_results(model, mod = "experimental_design", group = "group_ID")
num_studies(res$data, moderator, stdy)
# }

Run the code above in your browser using DataLab