title: How to build a ROC Curve for a classification random forest prediction in R?
body: <p>This is probably an easy question but I have been stuck on it for ages. I have build a classification random forest model to predict the classifications of my test set and attached the outcome to my dataframe as follows.</p>
  
  <pre><code>RandomTree &lt;- randomForest(as.factor(OutcomeVariable) ~ ., data=TrainSet, ntree=30 , 
  importance=TRUE, samplesize=c(5195,5195))
  Prediction&lt;-predict(RandomTree, TestSet, type="response")
  TestSet$Prediction&lt;-Prediction
  </code></pre>
  
  <p>I want to try and create a ROC curve and calculate the AUC from this. I understand the classification predictions need to be converted to probabilities however I am unsure of how to do this. 
  The reason for this is so I can compare the results of my random forest with a logistic regression I have also modeled. I was able to get a ROC curve from my logistic regression.</p>
  
  <p>Any help would be much appreciated. Thanks</p>