How to run ANOVA functions for a random forest model in R?
0
0
Entering edit mode
2.7 years ago

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')"
R random forest anova • 1.6k views
ADD COMMENT
0
Entering edit mode

Crossposted. Do not crosspost or at the very least link the posts.

ADD REPLY

Login before adding your answer.

Traffic: 2410 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6