Dear all,
I am trying to find out the best cutoff point for a logistic problem.
This is my MWE with standard data from stata:
"bysort group" is not allowed to "lsens" function. So I generated spec and sens for the all data set. The problem is that I have a lot of spec and sens missing for group 1 and thus can not get the mpg corresponding to the maximum youden. Is there a way to generate spec and sens for each group independently? Or what am I doing wrong?
Thanks in advance!
I am trying to find out the best cutoff point for a logistic problem.
This is my MWE with standard data from stata:
Code:
sysuse auto gen group = cond(mpg <20, 1, 2) bysort group: logit foreign c.mpg, nolog lsens , gensens(sensitivity) genspec(specificity) bysort group: generate float youden_index = sensitivity + specificity - 1 bysort group: egen float max = max(youden_index) bysort group: list mpg if youden_index == max
Thanks in advance!
Comment