Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

// 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


-----Original Message-----
From: Ariel Linden, DrPH [] 
Sent: Saturday, October 27, 2012 10:56 AM
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

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.


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


Try  mlogitroc 

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

Details are in this link


- ----------------------------------------
> From:
> To:
> 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 <>
> 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
> & gestwk_cat!=. & cigs_befx!=. & cigs_1stx!=. & cigs_2ndx!=. &
> & gestdb!=. & gesthy!=. & ht_cm!=. & plural==1 & edu_mom!=. & marriedxx!=.
> lroc
> I get the error message 'last estimates not found...'.
> 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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index