use https://www3.nd.edu/~rwilliam/statafiles/shuttle2.dta, clear * Date has been added to shuttle2.dta, but here is the command that created it. * gen date = mdy( month, day, year) mlogit distress date temp, b(1) * Compute the Z value predict z2, xb outcome(2) predict z3, xb outcome(3) * You could predict z1 – but it would be 0 for every case! * Get the predicted probabilities for each of the three possible outcomes. * Specify one var for each outcome predict none onetwo threeplus, p list flight temp date distress z none onetwo threeplus * Appendix A: Adjusted predictions & Marginal effects * Requires Stata 14+ webuse nhanes2f, clear keep if !missing(diabetes, black, female, age) label define black 0 "nonBlack" 1 "black" label define female 0 "male" 1 "female" label values black black label values female female fre health mlogit health i.female i.black c.age, nolog b(1) * AAPs using margins margins black *spost13 mtable, at(black = (0 1)) * AMEs using margins margins, dydx(black) mtable, dydx(black) * mtable mtable, at (black = (0 1) age = 20 ) at (black = (0 1) age = 47 ) at (black = (0 1) age = 74 ) dec(4) quietly mtable, at (black = 0 age = 20 ) rown(20 year old white) dec(4) quietly mtable, at (black = 1 age = 20 ) rown(20 year old black) dec(4) below quietly mtable, at (black = 0 age = 47 ) rown(47 year old white) dec(4) below quietly mtable, at (black = 1 age = 47 ) rown(47 year old black) dec(4) below quietly mtable, at (black = 0 age = 74 ) rown(74 year old white) dec(4) below mtable, at (black = 1 age = 74 ) rown(74 year old black) dec(4) below * Graphics using mgen * mgen for all all groups pooled together mgen, at(age = (20(5)75)) stub(all) list allpr1 allpr2 allpr3 allpr4 allpr5 allage in 1/15 sum allpr1 allpr2 allpr3 allpr4 allpr5 allage line allpr1 allpr2 allpr3 allpr4 allpr5 allage, scheme(sj) name(pooled) * mgen for groups drop allpr1 - allCpr5 mgen, at(age = (20(5)75) black = 0) stub(wh) predn(whpr) mgen, at(age = (20(5)75) black = 1) stub(bl) predn(blpr) line whwhpr1 blblpr1 whwhpr5 blblpr5 whage, scheme(sj) name(byrace) * mchange mchange black female age, stats(change start end) dec(5) delta(10)