* cda07a-review7.do - CDA Lab Guide 7: Models for Nominal Outcomes - 23May2007 capture log close set more off estimates clear * 1 open the log log using cda07a-review7.log, replace text version 9.2 set scheme s2mono * 2 load and clean the data use sci-review, clear keep jobprst pub1 phd female tab1 _all , m drop if jobprst>=. | pub1>=. | phd>=. | female>=. sum * 3 estimate multinomial logit mlogit jobprst pub1 phd female, basecategory(4) nolog estimates store base * 3.5 VCE vce * 4 odds ratios listcoef, help * 5 plot factor changes mlogplot pub1 phd female, std(ss0) p(.1) or ntics(9) graph export cda07a-review7-fig1.emf , replace *mlogview * 6 single variable LR test * the standard Stata way quietly mlogit jobprst pub1 phd, basecategory(4) estimates store nofemale lrtest base nofemale quietly mlogit jobprst pub1 female, basecategory(4) estimates store nophd lrtest base nophd quietly mlogit jobprst female phd, basecategory(4) estimates store nopub1 lrtest base nopub1 * the very cool s&j way quietly mlogit jobprst pub1 phd female mlogtest, lr * 7 single variable Wald test mlogit jobprst pub1 phd female, basecategory(4) * the standard Stata way test female test pub1 test phd * the very cool s&j way mlogtest, wald * 8 test if two outcomes can be combined * the standard Stata way test [1_Adeq] test [2_Good] * etc. * the very cool s&j way mlogtest, combine * 9 compute predicted values prvalue prvalue, x(female=1) rest(mean) * 10 marginal and discrete change prchange, rest(mean) * 11 plot discrete change quietly mlogit jobprst pub1 phd female, basecategory(4) * mlogview quietly prchange, rest(mean) mlogplot pub1 phd female, /// std(ss0) p(.1) min(-.15) max(.15) dc ntics(7) graph export cda07a-review7-fig2.emf , replace * 12 both discrete and factor changes mlogplot pub1 phd female, /// dc or std(ss0) p(.1) min(-.15) max(.15) sign ntics(7) graph export cda07a-review7-fig3.emf , replace * 13 test iia mlogtest, iia * 14 close up log close exit