# Plotting overlaid ROC curves

I'm trying to make overlaid ROC curves to represent successive improvements in model performance when particular predictors are added one at a time to the model. I want one ROC curve for each of about 5 nested models (which I will define manually), all overlaid in one plot. For example:

    #outcome var
y = c(rep(0,50), rep(1, 50))

#predictors
x1 = y + rnorm(100, sd = 1)
x2 = y + rnorm(100, sd = 4)

#correlations of predictors with outcome
cor(x1, y)
cor(x2, y)

library(Epi)
ROC(form = y ~ x1, plot = "ROC)
ROC(form = y ~ x1 + x2, plot = "ROC")


I'd want the two ROC curves on the same plot (and ideally without the distracting model info in the background). Any ggplot/graphics gurus willing to lend a hand?

-
The caTools package provides the colAUC function. Use it and set the plotROC argument to TRUE. I have been satisfied with the graphs it produces.
As long as the outcome is univariate/Bernoulli then sure. Just pass a matrix or data-frame to the X argument with each column representing the predictions from a different model. So matching your above example: colAUC(X=cbind(x1,x2),y=y,plotROC=TRUE) –  Shea Parkes May 25 '12 at 14:52
You would just need to build out the columns like this then colAUC(X=data.frame(fit1=x1,fit2=x1+x2),y=y,plotROC=TRUE) –  Shea Parkes May 28 '12 at 16:44