plot.roc<-function(predictors,gold){ sorted.predictors<-sort(unique(predictors)) ll<-length(sorted.predictors) num.pos<-length(predictors[gold==1]) num.neg<-length(predictors[gold==0]) tnf<-rep(0,ll) tpf<-rep(0,ll) for(i in 1:ll){ tnf[i]<-length(predictors[gold==0&predictors<=sorted.predictors[i]])/num.neg tpf[i]<-length(predictors[gold==1&predictors> sorted.predictors[i]])/num.pos } plot(1-tnf,tpf,type="l",xlab="False Positive Fraction",ylab="True Positive Fraction",xlim=c(0,1),ylim=c(0,1),lwd=6,cex.axis=1.75,cex.lab=1.5) }