Learn R Programming

orchaRd (version 2.2.1)

get_data_raw: get_data_raw

Description

Collects and builds the data used to fit the rma.mv or rma model in metafor.

Usage

get_data_raw(
  model,
  mod,
  group,
  N = NULL,
  at = NULL,
  subset = TRUE,
  upper = TRUE
)

Value

Returns a data frame

Arguments

model

rma.mv object.

mod

the moderator variable.

group

The grouping variable that one wishes to plot beside total effect sizes, k. This could be study, species, or whatever other grouping variable one wishes to present sample sizes.

N

The name of the column in the data specifying the sample size, N. Defaults to NULL, so precision is plotted instead of sample size.

at

List of moderators. If at is equal to mod then levels specified within at will be used to subset levels when subset = TRUE. Otherwise, it will marginalise over the moderators at the specified levels.

subset

Whether or not to subset levels within the mod argument. Defaults to FALSE.

upper

Logical indicating if the first letter of the moderator levels should be capitalized. Defaults to TRUE.

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 | group_ID, ~1 | es_ID),
  mods = ~ experimental_design + trait.type +
    deg_dif + treat_end_days,
  method = "REML", test = "t", data = warm_dat,
  control = list(optimizer = "optim",
    optmethod = "Nelder-Mead"))
test <- get_data_raw(
  model, mod = "trait.type",
  group = "group_ID",
  at = list(trait.type = c("physiology",
    "morphology")))
 test2 <- get_data_raw(model, mod = "1", group = "group_ID")
# }

Run the code above in your browser using DataLab