Skip to contents

Convenience wrapper around mars_rf() for formula-based univariate models.

Usage

mars_rf_univariate(
  data,
  formula,
  studyID,
  variance,
  structure = NULL,
  varcov_type = "univariate",
  missing = "remove",
  num_trees = 500L,
  mtry = NULL,
  minsplit = 10L,
  minbucket = 5L,
  cp = 0.001,
  maxdepth = 30L,
  sample_fraction = 1,
  seed = NULL,
  importance = TRUE,
  ...
)

Arguments

data

Data used for analysis.

formula

Formula used for univariate or multilevel models.

studyID

Character string representing the study ID.

variance

Character string naming the variance column for formula-based fits.

structure

Structure label. Use "univariate" or "multilevel" for formula-based models. Multivariate models are inferred from effectsize_type.

varcov_type

Type of within-study variance-covariance structure.

missing

Missing-data handling mode. Use "remove", "keep", or "em".

num_trees

Number of trees in the forest.

mtry

Number of candidate predictors randomly selected for each tree. Defaults to floor(sqrt(p)).

minsplit, minbucket

Tree-growing control parameters.

cp

Minimum split-improvement threshold for growing a new node.

maxdepth

Maximum tree depth.

sample_fraction

Fraction of studies sampled with replacement for each tree.

seed

Optional random seed.

importance

Logical; if TRUE, aggregate split-based variable importance across trees.

...

Not currently used.

Examples

if (FALSE) { # \dontrun{
rf_fit <- mars_rf_univariate(
  data = teacher_expectancy,
  formula = yi ~ year + weeks,
  studyID = "study",
  variance = "vi",
  num_trees = 25,
  seed = 123
)
summary(rf_fit)
} # }