Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Determining cutoff point after -lsens-

    Dear all,
    The accuraccy rate of my prediction model is very high that can be explained by imbalanced number of failure and non-failureobservations. I decided to use -lsens- command to find a more optimal cutoff point. What Stata command or option would allow to find the intersection point between sensitivity and specificity? Visually it is hard to figure it out.
    Attached Files

  • #2
    Code:
    *OPEN DATA SET AND RUN LOGIT REGRESSION
    webuse lbw, clear
    logit low age i.race
    *GENERATE CUTOFF, SENSITIVITY AND SPECIFICITY USING -LSENS- COMMAND 
    qui lsens, genprob(cutoff) gensens(sens) genspec(spec) nograph
    gen difference= sens-spec
    levelsof sens if abs(difference)<0.01, local(yval)
    levelsof cutoff if sens==`yval', local(xval)
    lsens, yline(`yval') xline(`xval') scheme(s1color) ylab(0 0.2 `yval' 0.8 1) xlab(0 0.2 `xval' 0.8 1)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	76.1 KB
ID:	1556518

    Comment

    Working...
    X