capture log close log using icpsrcda05-nominal, replace text // program: icpsrcda05-nominal.do // task: Review 5 - Nominal Regression // project: ICPSR CDA // author: tait medina \ 2009jun20 // #1 // program setup version 10 clear all set linesize 80 // #2 // Load data use icpsr_scireview3, clear // #3 // Examine data, select variables, drop missing, and verify codebook, compact keep jobprst pub1 phd female misschk, gen(m) tab mnumber keep if mnumber==0 tab1 jobprst pub1 female, mis sum phd // #4 // Estimate multinomial logit mlogit jobprst pub1 phd female, baseoutcome(4) nolog estimates store base // #5 // Single variable LR test quietly mlogit jobprst pub1 phd, baseoutcome(4) estimates store nofemale lrtest base nofemale **or using mlogtest quietly mlogit jobprst pub1 phd female, baseoutcome(4) nolog mlogtest, lr // #6 // Single coefficient wald test test female **or using mlogtest mlogtest , wald // #7 // Test if two outcomes can be combined test [1_Adeq] **or using mlogtest mlogtest, combine // #8 // Testing for iia set seed 4415906 mlogtest , iia // #9 // Predicted probabilities prvalue, rest(mean) // #10 // Marginal and discrete change prchange, rest(mean) // #11 // Plot discrete change mlogplot pub1 phd female, std(ss0) p(.1) /// note(Job: 1=Adeq 2=Good 3=Strong 4=Distinguished) dc ntics(9) graph export icpsrcda05-nominal-fig1.emf , replace // #12 // Odds ratios listcoef, help // #13 // Plot odds ratio mlogplot pub1 phd female, std(ss0) p(.1) /// note(Job: 1=Adeq 2=Good 3=Strong 4=Distinguished) or sign ntics(9) graph export icpsrcda05-nominal-fig2.emf , replace // #14 // Add discrete change to odds ratio plot mlogplot pub1 phd female, std(ss0) p(.1) /// note(Job: 1=Adeq 2=Good 3=Strong 4=Distinguished) or dc sign ntics(9) graph export icpsrcda05-nominal-fig3.emf , replace // #15 // Close log file and exit do file log close exit