Overlapping ROC curves in multi plot of ROC curves

99 Views Asked by At

I am trying to make a ROC plot with multiple univariate models. But two of my variables are overlapping since their AUC were similar (0.74 and 0.739). I was wondering if there was a way I can separate these curves?

This is the code I used:

par(pty="s")
roc(na.exclude(DATA$Outcome), glmVari1$fitted.values, plot=TRUE, legacy.axes=FALSE, percent=TRUE, col="maroon1", lwd=2)
plot.roc(na.exclude(DATA$Outcome), glmVari2$fitted.values, percent=TRUE, col="cyan", lwd=2, print.auc=FALSE, add=TRUE)
plot.roc(na.exclude(DATA$Outcome), glmVari3$fitted.values, percent=TRUE, col="skyblue3", lwd=2, print.auc=FALSE, add=TRUE)
plot.roc(na.exclude(DATA$Outcome), glmVari4$fitted.values, percent=TRUE, col="seagreen4", lwd=2, print.auc=FALSE, add=TRUE)
plot.roc(na.exclude(DATA$Outcome), glmVari5$fitted.values, percent=TRUE, col="green", lwd=2, print.auc=FALSE, add=TRUE)
plot.roc(na.exclude(DATA$Outcome), glmVari6$fitted.values, percent=TRUE, col="orangered3", lwd=2, print.auc=FALSE, add=TRUE)
legend("bottomright", c("Variable 1", "Variable 2", "Varible 3 ", "Variable 4", "Variable 5", "Variable 6"), 
col = c("maroon1", "cyan", "skyblue3", "seagreen4", "green", "orangered3"), lwd=2, cex = 0.62)

Using this code, I get the following plot. In this, Variable 6 and 4 are overlapping since they have the same AUC (0.74 and 0.739 respectively). Can you please help me on how to separate them in the code itself?

enter image description here

1

There are 1 best solutions below

1
Calimo On

You may want to make the line underneath wider with lwd

plot.roc(na.exclude(DATA$Outcome), glmVari4$fitted.values, percent=TRUE, col="seagreen4", lwd=4, print.auc=FALSE, add=TRUE)

Or you may want the curve on top of the other one to be dotted with lty

plot.roc(na.exclude(DATA$Outcome), glmVari6$fitted.values, percent=TRUE, col="orangered3", lwd=2, lty=3, print.auc=FALSE, add=TRUE)