To elaborate on Frank Harrell's answer, what the Epi
package did was to fit a logistic regression, and make a ROC curve with outcome predictions of the following form:
$$
outcome = \frac {1}{1+e^{-(\beta_0 + \beta_1 s100b + \beta_2 ndka)}}
$$
In your case, the fitted values are $\beta_0$ (intercept) = -2.379, $\beta_1$ (s100b) = 5.334 and $\beta_2$ (ndka) = 0.031. As you want your predicted outcome to be 0.312 (the "optimal" cutoff), you can then substitute this as (hope I didn't introduce errors here):
$$
0.312 = \frac {1}{1+e^{-(-2.379 + 5.334 s100b + 0.031 ndka)}}
$$
$$
1.588214 = 5.334 s100b + 0.031 ndka
$$
or:
$$
s100b = \frac{1.588214 - 0.031 ndka}{5.334}
$$
Any pair of (s100b, ndka) values that satisfy this equality is "optimal". Bad luck for you, there are an infinity of these pairs. For instance, (0.29, 1), (0, 51.2), etc. Even worse, most of them don't make any sense. What does the pair (-580, 10000) mean? Nothing!
In other words, you can't establish cut-offs on the inputs - you have to do it on the outputs, and that's the whole point of the model.
Yes, it's possible. An alternative definition of AUC is the probability that a randomly chosen ground-truth positive sample ranks higher than a ground-truth negative sample. So for example if we have class A having scores and classifications as:
[0.09,0.5,0.7]
[-,+, -]
Then the AUC = 1/2
For class B:
[0.095,0.41,0.42]
[-, +, -]
Then AUC = 1/2.
Combining the two:
[0.09,0.095,0.41,0.42,0.5,0.7]
[-,-,+,-,+,-]
AUC = (1/2)(1/2)+(3/4)(1/2) = 0.625.
Best Answer
Calculation formula:
ROC / AUC is the same criteria and the PR (Precision-Recall) curve (F1-score, Precision, Recall) is also the same criteria.
Real data will tend to have an imbalance between positive and negative samples. This imbalance has large effect on PR but not ROC/AUC.
So in the real world, the PR curve is used more since positive and negative samples are very uneven. The ROC/AUC curve does not reflect the performance of the classifier, but the PR curve can.
If you just do the experiment in research papers, you can use the ROC, the experimental results will be more beautiful. On another hand, PR curve use in the real problem, and it has better interpretability.