Learn R Programming

rfUtilities (version 2.0-0)

rf.significance: Random Forest model significance test

Description

Performs significance test for classification and regression Random Forests models.

Usage

rf.significance(x, xdata, q = 0.99, p = 0.05, nperm = 999, ...)

Arguments

x
randomForest class object
xdata
Independent variables (x) used in model
q
Quantile threshold to test classification models
p
p-value to test for significance in regression models
nperm
Number of permutations
...
Additional Random Forests arguments

Value

A list class object with the following components:For Regression problems:RandRsquare Vector of random R-square valuesRsquare The R-square of the "true" modelAccept Is the model significant at specified p-value (TRUE/FALSE)TestQuantile Quantile threshold used in significance plotpValueThreshold Specified p-valuepValue p-values of randomizationsnPerm Number of permutationsFor Classification problems:RandOOB Vector of random out-of-bag (OOB) valuesRandMaxError Maximum error of randomizationstest.OOB Error if the "true" modelAccept Is the model significant at specified p-value (TRUE/FALSE)TestQuantile Quantile threshold used in significance plotpValueThreshold Specified p-valuepValue p-values of randomizationsnPerm Number of permutations

References

Murphy M.A., J.S. Evans, and A.S. Storfer (2010) Quantify Bufo boreas connectivity in Yellowstone National Park with landscape genetics. Ecology 91:252-261

Evans J.S., M.A. Murphy, Z.A. Holden, S.A. Cushman (2011). Modeling species distribution and change using Random Forests CH.8 in Predictive Modeling in Landscape Ecology eds Drew, CA, Huettmann F, Wiersma Y. Springer

Examples

Run this code
## Not run: 
# # Regression
# require(randomForest)
#   set.seed(1234)	
#     data(airquality)
#     airquality <- na.omit(airquality)
#  ( rf.mdl <- randomForest(x=airquality[,2:6], y=airquality[,1]) )
#    ( rf.perm <- rf.significance(rf.mdl, airquality[,2:6], nperm=99, ntree=501) )
#  
# # Classification
# require(randomForest)
#   set.seed(1234)	
#     data(iris)
#       iris$Species <- as.factor(iris$Species) 
#  ( rf.mdl <- randomForest(iris[,1:4], iris[,"Species"], ntree=501) )
#    ( rf.perm <- rf.significance(rf.mdl, iris[,1:4], nperm=99, ntree=501) ) 
# ## End(Not run)

Run the code above in your browser using DataLab