I have a dataframe with two columns: score1
which numeric
and truth1
which is equal boolean
. I want to predict truth1
using score1
. To do this, I need a simple linear model, and then ask for a good threshold, i.e. A threshold that gives me 75% sensitivity in my ROC curve. Therefore, I:
roc_curve = roc(truth1 ~ score1 , data = my_data)
coords(roc=roc_curve, x = 0.75, input='sensitivity', ret='threshold')
My problem is that the coords return "NA" because the 0.75 sensitivity does not appear in the ROC curve. So, here is my question: how can I get a threshold that gives me a sensitivity of at least 0.75, with maximum specificity?
source
share