Learn R Programming

orchaRd (version 2.2.1)

mod_is_valid: Validate 'mod'

Description

Checks if `mod` argument is valid. This argument must be either `"1"` (indicating an intercept-only model) or a moderator that is included in the meta-analytic model (as specified in `model$formula.mods`).

Usage

mod_is_valid(model, mod)

Value

A logical value: TRUE if `mod` is valid, strop and throw an error otherwise.

Arguments

model

A meta-analytic model from the metafor package.

mod

A string specifying the moderator to check. Must be `"1"` or one of the moderators included in model$formula.mods.