Learn R Programming

ggRandomForests (version 2.1.0)

gg_vimp: Variable Importance (VIMP) data object

Description

gg_vimp Extracts the variable importance (VIMP) information from a a rfsrc object.

Usage

gg_vimp(object, nvar, ...)

Arguments

object

A rfsrc object or output from vimp

nvar

argument to control the number of variables included in the output.

...

arguments passed to the vimp.rfsrc function if the rfsrc object does not contain importance information.

Value

gg_vimp object. A data.frame of VIMP measures, in rank order.

References

Ishwaran H. (2007). Variable importance in binary regression trees and forests, Electronic J. Statist., 1:519-537.

See Also

plot.gg_vimp rfsrc vimp

Examples

Run this code
# NOT RUN {
## ------------------------------------------------------------
## classification example
## ------------------------------------------------------------
## -------- iris data
# rfsrc_iris <- rfsrc(Species ~ ., data = iris)
data(rfsrc_iris, package="ggRandomForests")
gg_dta <- gg_vimp(rfsrc_iris)
plot(gg_dta)
 
## ------------------------------------------------------------
## regression example
## ------------------------------------------------------------
# }
# NOT RUN {
## -------- air quality data 
# rfsrc_airq <- rfsrc(Ozone ~ ., airquality)
data(rfsrc_airq, package="ggRandomForests")
gg_dta <- gg_vimp(rfsrc_airq)
plot(gg_dta)
# }
# NOT RUN {
## -------- Boston data
data(rfsrc_Boston, package="ggRandomForests")
gg_dta <- gg_vimp(rfsrc_Boston)
plot(gg_dta)

# }
# NOT RUN {
## -------- mtcars data
data(rfsrc_mtcars, package="ggRandomForests")
gg_dta <- gg_vimp(rfsrc_mtcars)
plot(gg_dta)
# }
# NOT RUN {
## ------------------------------------------------------------
## survival example
## ------------------------------------------------------------
# }
# NOT RUN {
## -------- veteran data
data(rfsrc_veteran, package="ggRandomForests")
gg_dta <- gg_vimp(rfsrc_veteran)
plot(gg_dta)


## -------- pbc data
data(rfsrc_pbc, package="ggRandomForests")
gg_dta <- gg_vimp(rfsrc_pbc)
plot(gg_dta)

# Restrict to only the top 10.
gg_dta <- gg_vimp(rfsrc_pbc, nvar=10)
plot(gg_dta)
# }

Run the code above in your browser using DataLab