Announcement

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

  • max Youden index

    Dear experts
    I am performing a ROC analysis.
    Is there a STATA function which calculates the cut-off value corresponding to the maximum Youden index (sensitivity + specificity -1)?
    Thanks

  • #2
    If there isn't a user-written command, then you can use a combination of minbound and estat classification, but it might be easier just to
    Code:
    sysuse auto
    logit foreign c.mpg, nolog
    lsens , gensens(sensitivity) genspec(specificity)
    generate float youden_index = sensitivity + specificity - 1
    egen float max = max(youden_index)
    list mpg if youden_index == max
    I think that some try to interpolate between the maximum and next-highest, but that gives the whole exercise an aura of legitimacy that seems undeserved.
    Last edited by Joseph Coveney; 08 Nov 2017, 05:29.

    Comment


    • #3
      Phil Clayton's cutpt command (SSC) may improve on Joseph's procedure (one I've used myself) when the classification variable is continuous. See also this thread,
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        Hi,

        thanks for great advice, how do I get the probability cutoff value where the two lines intersect?

        Thank you in advance,

        Fredrik
        Click image for larger version

Name:	ROC cut off.png
Views:	1
Size:	246.2 KB
ID:	1442935

        Comment


        • #5
          Originally posted by Fredrik Hjelm View Post
          how do I get the probability cutoff value where the two lines intersect?
          Code:
          sysuse auto
          logit foreign c.mpg, nolog
          lsens , genprob(cutoff_p) gensens(sensitivity) genspec(specificity)
          generate float abs_delta = abs(sensitivity - specificity)
          egen float min = min(abs_delta)
          list cutoff_p if abs_delta == min
          What am I missing with all this?

          Comment


          • #6
            Originally posted by Joseph Coveney View Post
            If there isn't a user-written command, then you can use a combination of minbound and estat classification, but it might be easier just to
            Code:
            sysuse auto
            logit foreign c.mpg, nolog
            lsens , gensens(sensitivity) genspec(specificity)
            generate float youden_index = sensitivity + specificity - 1
            egen float max = max(youden_index)
            list mpg if youden_index == max
            I think that some try to interpolate between the maximum and next-highest, but that gives the whole exercise an aura of legitimacy that seems undeserved.
            Joseph, thank you so much! I was trying to find how to calculate cut-off in Stata for weeks now. Your solution gave me exact results as in R. Finally, thanks a lot!

            Comment

            Working...
            X