I would like the prediction after a probit to be equal for 1 and 0
classified.
Thus, I have to adjust the cutoff(x). But which value should x have?
The following loop should do the job, but somehow I have a problem with
the rounding. I.e. the thing flips between the first two sub-loops.
Can somebody help me on this?
local cutoff = 0.33 /* starting value */
forvalue x = 1/100000 {
display `x'
qui lstat, cutoff(`cutoff')
local equal = round(r(P_p1),0.000001) - round(r(P_n0),000001)
/* Sensitivity - Specificity */
display `equal'
if `equal' > 0 {
local cutoff = `cutoff' + 0.000001
display `cutoff'
}
else if `equal' < 0 {
local cutoff = `cutoff' - 0.000001
display `cutoff'
}
else if `equal' == round(0,0.000001) {
lstat, cutoff(`cuttoff')
}
}
Many thanks
Hans
--
Hans J. Baumgartner
DIW Berlin
Deutsches Institut f�r Wirtschaftsforschung
German Institute for Economic Research
Abt. Staat / Dept. Public Economics
K�nigin-Luise-Str. 5; 14195 Berlin; Germany
Tel.: +49/30/89789-307; Fax.: +49/30/89789-114 http://www.diw.de http://www.hansbaumgartner.de