capture log close log using cda04a-ordinal-rev.log, text replace // pgm: cda04a-ordinal-rev.do // task: Review 4 - Ordinal Regression // project: CDA // author: your name // date: today's date * 1 setup version 10 set linesize 80 clear all macro drop _all * 2 load data use sci-review2, clear * 3 select variables and examine keep jobprst pub1 phd female sum jobprst pub1 phd female tab jobprst , m * 4 ordered logit ologit jobprst pub1 phd female * 5 predicted probabilities in sample predict jpad jpgo jpst jpdi label var jpad "OLM Pr(Adeq)" label var jpgo "OLM Pr(Good)" label var jpst "OLM Pr(Strg)" label var jpdi "OLM Pr(Dist)" * 6 plot predictions dotplot jpad jpgo jpst jpdi, ylabel(0(.25).75) graph export cda04a-ordinal-rev-fig1.emf , replace * 7 predict specific probabilities prvalue, x(female=1 phd=4) rest(mean) * 8 graph predicted probabilities prgen pub1, x(female=1 phd=4) rest(mean) from(0) to(20) gen(pubpr) label var pubprs1 "Pr(<=Adeq)" label var pubprs2 "Pr(<=Good)" label var pubprs3 "Pr(<=Strg)" label var pubprs4 "Pr(<=Dist)" graph twoway (connected pubprs1 pubprs2 pubprs3 pubprs4 pubprx, /// title("Job Prestige and Pubications") /// subtitle("for Females from Distinguished PhD Programs") /// ytitle("Cumulative Pr(Job Prestige)") /// xtitle("Publications: PhD yr -1 to 1") /// xlabel(0(5)20) ylabel(0(.25)1, grid) /// msymbol(Oh Dh Sh Th) name(tmp2, replace) /// text(.01 .75 "Adeq", place(e)) /// text(.22 5 "Good", place(e)) /// text(.60 10 "Strong", place(e)) /// text(.90 17 "Dist", place(e))), /// legend(off) graph export cda04a-ordinal-rev-fig2.emf , replace * 9 compute marginal and discrete change prchange, x(female=1 phd=4) rest(mean) * 10 confidence intervals for discrete change qui prvalue, x(female=1 phd=4 pub1=0) rest(mean) label(lowpubs) save prvalue, x(female=1 phd=4 pub1=19) rest(mean) label(hipubs) dif * 11 odds ratios listcoef, help * 12 parallel regressions assumption brant, detail * 13 close log & exit do-file log close exit