Learn R Programming

ggRandomForests (version 2.0.1)

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
## ------------------------------------------------------------
## 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)
# ## End(Not run)
## Not run: 
# ## -------- Boston data
# data(rfsrc_Boston, package="ggRandomForests")
# gg_dta <- gg_vimp(rfsrc_Boston)
# plot(gg_dta)
# ## End(Not run)
## Not run: 
# ## -------- mtcars data
# data(rfsrc_mtcars, package="ggRandomForests")
# gg_dta <- gg_vimp(rfsrc_mtcars)
# plot(gg_dta)
# ## End(Not run)
## ------------------------------------------------------------
## survival example
## ------------------------------------------------------------
## Not run: 
# ## -------- veteran data
# data(rfsrc_veteran, package="ggRandomForests")
# gg_dta <- gg_vimp(rfsrc_veteran)
# plot(gg_dta)
# ## End(Not run)
## Not run: 
# ## -------- 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)
# ## End(Not run)

Run the code above in your browser using DataLab