Announcement

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

  • 95% confidence interval for lroc?

    Hi,

    I am using lroc after different logistic regression models to estimate the area under the ROC curve. I was wondering if there is a way to include/calculate a 95% confidence interval for the AUC...?

    Thanks,
    Robin

    PHP Code:
    logistic y c.var1 i.var2 i.var3base

    lroc
    nograph 

  • #2
    Originally posted by Robin Fatch View Post
    I am using lroc after different logistic regression models to estimate the area under the ROC curve. I was wondering if there is a way to include/calculate a 95% confidence interval for the AUC...?
    Yes: substitute the following two lines of code (in red) for your lroc , nograph line.
    Code:
    logistic y c.var1 i.var2 i.var3, base
    predict double xb, xb
    roctab foreign xb

    Comment


    • #3
      Sorry, those lines were copied from an illustration using the auto dataset.

      Use the following final line for your displayed code.
      Code:
      roctab y xb
      Here's the illustration, if you're curious.

      .ÿ
      .ÿversionÿ16.1

      .ÿ
      .ÿclearÿ*

      .ÿ
      .ÿsetÿseedÿ`=strreverse("1560592")'

      .ÿ
      .ÿquietlyÿsysuseÿauto

      .ÿ
      .ÿsummarizeÿrep78,ÿmeanonly

      .ÿquietlyÿreplaceÿrep78ÿ=ÿruniformint(r(min),ÿr(max))ÿifÿmi(rep78)

      .ÿ
      .ÿquietlyÿlogisticÿforeignÿc.gear_ratioÿi.rep78,ÿbase

      .ÿlrocÿ,ÿnograph

      Logisticÿmodelÿforÿforeign

      numberÿofÿobservationsÿ=ÿÿÿÿÿÿÿ71
      areaÿunderÿROCÿcurveÿÿÿ=ÿÿÿ0.9652

      .ÿ
      .ÿtempnameÿarea

      .ÿscalarÿdefineÿ`area'ÿ=ÿr(area)

      .ÿ
      .ÿ*
      .ÿ*ÿBeginÿhere
      .ÿ*
      .ÿquietlyÿpredictÿdoubleÿxb,ÿxb

      .ÿroctabÿforeignÿxb

      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿROCÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-AsymptoticÿNormal--
      ÿÿÿÿÿÿÿÿÿÿÿObsÿÿÿÿÿÿÿAreaÿÿÿÿÿStd.ÿErr.ÿÿÿÿÿÿ[95%ÿConf.ÿInterval]
      ÿÿÿÿÿ------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿÿÿÿ71ÿÿÿÿÿ0.9652ÿÿÿÿÿÿÿ0.0217ÿÿÿÿÿÿÿÿ0.92272ÿÿÿÿÿ1.00000

      .ÿ
      .ÿassertÿr(area)ÿ==ÿ`area'

      .ÿ
      .ÿexit

      endÿofÿdo-file


      .

      Comment

      Working...
      X