preselect_vars {metaforest} | R Documentation |
Extract variable names from mf_preselect object
Description
Returns a vector of variable names from an mf_preselect object, based on a cutoff criterion provided.
Usage
preselect_vars(x, cutoff = NULL, criterion = NULL)
Arguments
x |
Object of class mf_preselect. |
cutoff |
Numeric. Must be a value between 0 and 1. By default, uses .95 for bootstrapped preselection, and .1 for recursive preselection. |
criterion |
Character. Which criterion to use. See |
Details
For criterion = 'p'
, the function evaluates the proportion of
replications in which a variable achieved a positive (>0) variable
importance. For criterion = 'ci'
, the function evaluates whether the
lower bound of a confidence interval of a variable's importance across
replications exceeds zero. The width of the confidence interval is determined
by cutoff
.
For recursive preselection, any variable not included in a final model is assigned zero importance.
Value
Character vector.
Examples
## Not run:
data <- get(data(dat.bourassa1996))
data <- escalc(measure = "OR", ai = lh.le, bi = lh.re, ci = rh.le, di= rh.re,
data = data, add = 1/2, to = "all")
data$mage[is.na(data$mage)] <- median(data$mage, na.rm = TRUE)
data[c(5:8)] <- lapply(data[c(5:8)], factor)
data$yi <- as.numeric(data$yi)
preselected <- preselect(formula = yi~ selection + investigator + hand_assess + eye_assess +
mage +sex,
data, study = "sample",
whichweights = "unif", num.trees = 300,
replications = 10,
algorithm = "bootstrap")
preselect_vars(preselected)
## End(Not run)