Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# RE: re: RE: st: Area under the curve and C-statistics

 From "Ariel Linden, DrPH" To Subject RE: re: RE: st: Area under the curve and C-statistics Date Sat, 27 Oct 2012 11:19:42 -0400

```I was thinking about perhaps something along these lines...

// run mlogit on insure with 3 levels of the outcome

webuse sysdsn1
mlogit insure age male nonwhite i.site

// save predictions of each level of outcome
predict p1 if e(sample), outcome(1)
predict p2 if e(sample), outcome(2)
predict p3 if e(sample), outcome(3)

// generate dummy variables for each level
tab insure, gen(type)

// compare ROC curves for each predicted level of outcome to actual level 1
roccomp type1 p1 p2 p3, graph summary

Ariel

-----Original Message-----
From: Ariel Linden, DrPH [mailto:ariel.linden@gmail.com]
Sent: Saturday, October 27, 2012 10:56 AM
To: statalist@hsphsun2.harvard.edu
Subject: re: RE: st: Area under the curve and C-statistics

This is an interesting program -mlogitroc-, but the output is not intuitive.
I'll have to read through the reference papers

To be more concrete, I just tried running the following code (which is used
in the Stata manual for mlogit):

webuse sysdsn1
xi: mlogitroc insure age male nonwhite i.site

The output provides one ROC curve, where I would have expected 3 (three
levels of the outcome -insure-). Thus, I am not sure which of the levels
this ROC curve represents.

Ariel

Date: Fri, 26 Oct 2012 21:56:04 +0100
From: Abdelouahid Tajar <a_tajar@hotmail.co.uk>
Subject: RE: st: Area under the curve and C-statistics

Hi,

Try  mlogitroc

mlogitroc  generates multiclass ROC curves for classification accuracy based
on multinomial logistic regression using mlogit.

http://ideas.repec.org/c/boc/bocode/s457181.html

Abdelouahid

- ----------------------------------------
> From: ariel.linden@gmail.com
> To: statalist@hsphsun2.harvard.edu
> Subject: re: st: Area under the curve and C-statistics
> Date: Fri, 26 Oct 2012 11:12:30 -0400
>
> Hi Amal,
>
> -lroc- is a post-estimation command for running after logistic
> regression, so it is not surprising that you got that error.
>
> It seems to me that since a multinomial regression is basically a
> series of logistic models, you could run each model separately (i.e.,
> 2 vs 1, 3 vs 1,
> 4 vs 1, etc.) and then plot all those results together using -roccomp-.
>
> Perhaps there is another way of doing this, but I just did a google
> search and didn't find any relevant results.
>
> Ariel
>
> Date: Thu, 25 Oct 2012 19:38:49 +0000
> From: Amal Khanolkar <Amal.Khanolkar@ki.se>
> Subject: st: Area under the curve and C-statistics
>
> Hi,
>
> I've used C statistics before and produced graphs that depict area
> under the curve for logistic regression models.
>
> Is it possible to do the same for multinomial logistics regression models?
>
> I tried running:
>
> mlogit moth_wtgainbybmi i.mom_race2 age_mom sexx, base(1) rrr, if
parity!=.
> & gestwk_cat!=. & cigs_befx!=. & cigs_1stx!=. & cigs_2ndx!=. &
cigs_3rdx!=.
> & gestdb!=. & gesthy!=. & ht_cm!=. & plural==1 & edu_mom!=. & marriedxx!=.
>
>
> lroc
>
>
> I assume that 'lroc' is suitable after using the 'logistic' command.
>
> Is there an equivalent for 'lroc' and 'roccomp' for multinomial
> logistic regression?
>
> Thanks,
>
> /Amal.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```