imp: Evaluating variable importance in 'rpart_ci()' trees

View source: R/imp.R

impR Documentation

Evaluating variable importance in rpart_ci() trees

Description

This function measures the variable importance for objects produced by rpart_ci()

Usage

imp(object, surrogates = TRUE, competes = FALSE, ...)

Arguments

object

an object of class rpart.

surrogates

should surrogate splits contribute to the importance calculation (logical)? Defaults to TRUE.

competes

should competing splits contribute to the importance calculation (logical)? Defaults to FALSE.

...

currently ignored.

Value

A data.frame with one row for each predictor variable (ordered by decreasing importance). The first column overall.importance is the variable importance measure (the total decrease in node impurities) and the second column relative.importance is the relative importance variable.

Author(s)

Saveria Willimes

References

Breiman, L., Friedman, J., Stone, C. J., & Olshen, R. A. (1984). Classification and regression trees. CRC press.

Examples

data(nigeria)

tree <-
rpart_ci(
  cbind(wealth, zscore1) ~
    quintile + ed + rural + region + male + bord + agechild + agemother,
  data = nigeria,
  weights = nigeria$weight,
  type = "CI")

imp(tree, surrogates = FALSE, competes = TRUE)

brechtdv/rineq documentation built on Feb. 21, 2024, 2:18 p.m.