Does anyone know how to get the optimal cutoff point of lroc curve after a probit estimation?
-
Login or Register
- Log in with
* get predicted probabilities predict prhat, pr * compute the diagnostic statistics table for all thresholds * Note: change true_outcome with your actual outcome variable. roctab true_outcome prhat, detail
version 16.0 clear * set seed `=strreverse("1531837")' quietly set obs 10000 generate double sco = runiform() generate double xb = invnormal(sco) + rnormal() generate byte dis = rbinomial(1, normal(xb)) probit dis c.sco, nolog * * Begin here * program define maxim, rclass version 16.0 estat classification, cutoff(`=`1'') return scalar fx = 100 - r(P_corr) // or (100 - r(P_corr))^2 end minbound maxim, range(0.01 0.99) from(0.5) display in smcl as text char(34) + "optimum" + char(34)+ " cutoff: " %05.3f r(x) exit
Comment