webuse sysdsn1, clear tabulate insure nonwhite, chi2 col mlogit insure age i.male i.nonwhite i.site, base(2) predict p1 if e(sample), outcome(1) predict p2 if e(sample), outcome(2) summarize p1 p2 histogram p1 mlogit, rrr gen byte nonwhold = nonwhite // save real race replace nonwhite = 0 // make everyone white predict wpind, outcome(Indemnity) // predict probabilities predict wpp, outcome(Prepaid) predict wpnoi, outcome(Uninsure) replace nonwhite=1 // make everyone nonwhite predict nwpind, outcome(Indemnity) predict nwpp, outcome(Prepaid) predict nwpnoi, outcome(Uninsure) replace nonwhite=nonwhold // restore real race summarize wp* nwp*, sep(3) margins nonwhite, predict(outcome(Prepaid)) noesample margins nonwhite, predict(outcome(Indemnity)) noesample predict indem, outcome(Indemnity) index // obtain indexes predict prepaid, outcome(Prepaid) index gen diff = prepaid-indem // obtain difference predict sediff, outcome(Indemnity,Prepaid) stddp // & its standard error gen type = 1 if diff/sediff < -1.96 // definitely indemnity replace type = 3 if diff/sediff > 1.96 // definitely prepaid replace type = 2 if type>=. & diff/sediff < . // ambiguous label def type 1 "Def Ind" 2 "Ambiguous" 3 "Def Prep" label values type type // label results tabulate insure type