capture log close log using icpsrcda04-ordinal, replace text // program: icpsrcda04-ordinal.do // task: Review 4 - Ordinal 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 // 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 icpsrcda04-ordinal-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 icpsrcda04-ordinal-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 file and exit do file log close exit