<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class="">Hello to everyone,</span><div id="yiv7521709717" class="" style=""><div class="" style=""><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;" class=""><div id="yiv7521709717yui_3_16_0_1_1411544231556_6838" class="" style=""></div></div></div></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class=""><br style=""></span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"
 class="">I am interested in doing some iteration in using Random Forest (classification purpose) with different value of mtry= 2, 4, 6, 9, 12. I want to repeat each run 100 times. that is with mtry=2 for example, run it 100 times. As output, I would like to have the aggregate out of bag errors (total means over the 100 runs) as well as well as the variable importance based on this 100 runs aggregated over their OBB errors. One could try it one by one, report each value but it is very laborious. Is there anyway to have R run the Random Forest 100 times, and give me as output the resulting (aggregated means) OOB errors and variable importance. here was my code. </span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class=""><br class="" style=""></span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica,
 Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class="">r2  <-  randomForest(Factor  ~  .,  data=tr, nodesize  = 1,ntree=1000, importance=TRUE, proximity=TRUE, mtry=2) </span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class="">#I want a 100 run of this</span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class="">#get average OOB errors</span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class="">#get variable importance based on these aggregated OBB errors.</span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;
 font-size: 13px;" class=""><br></span></div><div class="" style=""><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class="">Thank you very much.</span></div><div class="" style=""><br></div></div></body></html>