Search code examples
rproc-r-package

pROC package to compute AUC


Looking at the pROC package I am a bit confused about response and predictor:

response: a factor, numeric or character vector of responses, typically encoded with 0 (controls) and 1 (cases). The object. Only two classes can be used in a ROC curve. If the vector contains more than two unique values, or if their order could be ambiguous, use levels to specify which values must be used as control and case value.

predictor: a numeric vector, containing the value of each observation. An ordered factor is coerced to a numeric.

For example if I use:

auc(response, predictor)

Is response the truth and predictor what my model produces?

My 'truth' is either 0 or 1 and the predictor vector contains probabilities.


Solution

  • You seem to have it (almost) correctly stated. The answer that the ROC curve provides is what degree of positive or negative accuracy might be expected if the truth were known. The last sentence, however, a is incorrect tot he extent that you offer a) the response and b) the measurements or score from your model rather than probabilities. The software should return and plot the sensitivities and complement of specificities after producing a series of tabulations at various levels of of cutoff values in the particular cases and controls.

    The most informative ROC plots will label the cutoff values on the ROC curve. When I used that package there was no such labeling and I Seder to search for other packages.