After many hours of research, trial and error and frustration I hope someone here will be able to guide me in the right direction. I am fairly new to R and statistics and can not wrap my hand about the workings of the roc.curve() function of the PRROC package in R. My goal is to plot a ROC curve in the standard fashion provided by the PRROC package like this:
I now want to plot the ROC curve for the fitted logistic regression model with the testdata. My problem is, that I only get AUC values either 1 or 0 according to the order I put in my data in the curve is rectangluar.
Can someone see my mistake? Any help is greatly appreciated.
library(PRROC) # Split set # Subset # Logistic regression # predict test-data # ROC curve plot NOT WORKING x<-c(fg_data,bg_data) y<-c(rep(1,length(fg_data)),rep(0,length(bg_data))) roc<-roc.curve(scores.class0 = x, weights.class0 = y, curve = TRUE) plot(roc)