Bookmark and Share

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


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

Re: st: Accuracy table after mlogit


From   tzygmund mcfarlane <[email protected]>
To   [email protected]
Subject   Re: st: Accuracy table after mlogit
Date   Tue, 26 Jul 2011 10:22:55 -0700

You can do this by hand. I first show how you can recreate the -estat
classification- results for -logit- (not all the concomitant
statistics, but you can do those easily as well), and then follow the
same procedure for -mlogit-. Note that the way the predicted choices
are computed (the choice corresponding to the maximum predicted
probability) is in no way the only way to compute predicted
multinomial choices:

/**************************/
// logit
webuse lbw, clear
logit low age lwt i.race smoke ptl ht ui
estat classification
predict prob
g pred_choice = (prob >= 0.5)
tab pred_choice low  // recreate -estat classification-

// mlogit
webuse sysdsn1, clear
mlogit insure age male nonwhite i.site
predict prob*
egen pred_max = rowmax(prob*)

g pred_choice = .
forv i=1/3 {
 replace pred_choice = `i' if (pred_max == prob`i')
}
local insure_lab: value label insure
label values pred_choice `insure_lab'
tab pred_choice insure
/**************************/


This is what is typically called the confusion matrix.

T


On Tue, Jul 26, 2011 at 7:02 AM,  <[email protected]> wrote:
> Hi all,
>
> I can't get an accuracy classification table after running a simple multinomial regression (mlogit).
> After a normal logit regression I simply type
>
> estat classification
>
> and it works. But after mlogit I type in the same thing and I get:
>
>
> . estat classification
> invalid subcommand classification
> r(321);
>
> Is there a special command I should use for mlogit in order to get this kind of accuracy table?
>
> Many thanks,
>
> Natacha
>
>
>
> Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index