ROC {ModTools} | R Documentation |
Build a ROC curve
Description
This is a wrapper to the main function pROC
of the pROC package (by Xavier Robin et al.). It builds a ROC curve and returns a "roc"
object, a list of class "roc"
.
Usage
ROC(x, resp = NULL, ...)
Arguments
x |
a model object, or the predicted probabilities, when resp is not |
resp |
the response |
... |
all arguments are passed to |
Details
Partial ROC is calculated following Peterson et al. (2008; doi:10.1016/j.ecolmodel.2007.11.008). This function is a modification of the PartialROC funcion, available at https://github.com/narayanibarve/ENMGadgets.
Value
A data.frame containing the AUC values and AUC ratios calculated for each iteration.
Author(s)
Andri Signorell <andri@signorell.net>
References
Peterson, A.T. et al. (2008) Rethinking receiver operating characteristic analysis applications in ecological niche modeling. Ecol. Modell., 213, 63-72.
See Also
Examples
r.glm <- FitMod(diabetes ~ ., data = d.pima, fitfn="logit")
ROC(r.glm)
# plot ROC curves for a list of models
r.rp <- FitMod(diabetes ~ ., data = d.pima, fitfn="rpart")
# combine models to a list
mlst <- list(r.glm, r.rp)
# do the plot
for(i in seq_along(mlst))
if(i==1){
plot(ROC(mlst[[i]], grid=TRUE, col=c(hred, hblue)[i]))
} else {
lines(ROC(mlst[[i]], col=c(hred, hblue)[i]))
}