4
$\begingroup$

I am experimenting with logistic regression to predict a binary target variable.

Using Stata, I have generated predicted probabilities between 0 and 1.

Now, I am trying to think about how to translate these probabilities into the binary classification. Using a rule like "<50%==0 and >=50%==1" feels arbitrary, but I haven't found a better solution so far.

Any ideas?

$\endgroup$
2

2 Answers 2

4
$\begingroup$

ROC (Receiver operating characteristic) curve (http://en.wikipedia.org/wiki/Receiver_operating_characteristic) is one way of finding best cutoff and is widely used for this purpose. From http://www.stata.com/manuals14/rroc.pdf :

ROC analysis quantifies the accuracy of diagnostic tests or other evaluation modalities used to discriminate between two states or condition

You can use roctab, roccomp, rocfit, rocgold, rocreg, and rocregplot in stata for this purpose.

The cutoff that gives curve with maximum area under it is the best, as shown in following figure from http://www.adscience.eu/uploads/ckfiles/files/html_files/StatEL/statel_ROC_curve.htm

enter image description here

$\endgroup$
1
  • $\begingroup$ but the different curves here are not results of different cutoffs, but different models. Rather, each curve is plotted out by changing cutoff values from 0 to 1. So ROC cannot be used to determine the best cutoff, because ROC itself is generated by changing cutoff over its possible values. $\endgroup$
    – mirkhosro
    Commented Feb 28, 2023 at 6:54
1
$\begingroup$

In STATA you can compute the cutoffs by typing in the shell:

lsens, genprob('var_name')

after the logistic command; the var_name is arbitrary and it corresponds to the name of the cutoff variable you are going to generate. The variable you will create contains a set of cutoff points you can use to test the predictability capacity of your model.

Alternatively, once you got the vector of possible cutoff points in STATA, you can find the optimal (theoretically) cutoff by computing the Youden's index, that summarize the performance of the diagnostics test.

Here, you can find the link to the command guide and example on using the lsens command.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.