Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

How to run ANOVA functions for a random forest model in R?

$
0
0

I need to do an ANOVA on a random forest model. Calling the same code I use for glm and gam models doesn't with my rf model. What code shall I use to make it work?

I am using the sdm package from R to build my rf model. The rf model runs ok, however, I can't use the ANOVA function on the results.

MRF <- sdm(presence~.,data=dM,methods='rf',replication='sub',test.percent=20)

anova(MRF)

Error in UseMethod("anova") : no applicable method for 'anova' applied to an object of class "sdmModels

I have also tried this option :

m <-MRF@models$presence$rf$`1`@object

anova(m)

Error in UseMethod("anova") : no applicable method for 'anova' applied to an object of class "c('randomForest.formula', 'randomForest')"


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>