varUsed.icrf: 'Variables used in' an 'icrf' ensemble

View source: R/varUsed.R

varUsed.icrfR Documentation

'Variables used in' an icrf ensemble

Description

'Find out which predictor variables are actually used in' the returned forest of the icrf. The returned forest depends on the returnBest argument of the icrf function; It is either the last forest, when returnBest = FALSE or the the best forest, when returnBest = TRUE. (Quoted statements are from randomForest by Liaw and Wiener unless otherwise mentioned.)

Usage

varUsed(x, ...)

## S3 method for class 'icrf'
varUsed(x, by.tree = FALSE, count = TRUE, ...)

Arguments

x

'an object of class' icrf.

...

not used.

by.tree

'Should the list of variables used be broken down by trees in the forest?'

count

'Should the frequencies that variables appear in trees be returned?'

Value

'A vector containing number of nodes for the trees' in the icrf object.

'If count=TRUE and by.tree=FALSE, an integer vector containing frequencies that variables are used in the forest. If by.tree=TRUE, a matrix is returned, breaking down the counts by tree (each column corresponding to one tree and each row to a variable).'

'If count=FALSE and by.tree=TRUE, a list of integer indices is returned giving the variables used in the trees, else if by.tree=FALSE, a vector of integer indices giving the variables used in the entire forest.'

Author(s)

Hunyong Cho, Nicholas P. Jewell, and Michael R. Kosorok.

References

Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"

Examples

# rats data example.
# Note that this is a toy example. Use a larger ntree and nfold in practice.
data(rat2)

 set.seed(1)
 rats.icrf <-
   icrf(~ dose.lvl + weight + male + cage.no, data = rat2,
        data.type = "currentstatus", currentstatus.label = c("survtime", "tumor"),
        returnBest = TRUE, ntree=10, nfold=3)
 varUsed(rats.icrf)




icrf documentation built on Oct. 30, 2022, 1:05 a.m.

Related to varUsed.icrf in icrf...