capture log close set more off estimates clear local job cda_notes_ch5_ord local date "18Apr2006" log using cda_notes_ch5_ord, replace version 9.1 set scheme s2manual // cda_notes_ch5_ord: ICPSR CDA Chapter 5 - ordinal regressions // 18Apr2006 jsl // compare ordered logit and probit use ordwarm2, clear * 1: ordinal logit ologit warm yr89 male white age ed prst, nolog est store ologit * 2: ordinal probit oprobit warm yr89 male white age ed prst est store oprobit * 3: compare estimates estimates table _all, stats(N chi2 bic) b(%9.3f) t(%6.2f) * 4: standardized coefficients for oprobit listcoef, help // predicted probabilities ologit warm yr89 male white age ed prst, nolog * 5: table of probabilities prtab yr89 male, rest(mean) novar * 6: discrete change using prvalue prvalue, x(yr89=0 male=1) rest(mean) save prvalue, x(yr89=0 male=0) rest(mean) dif * 7: discrete change with prchange prchange, x(male=0 yr89=1) rest(mean) // plotting probabilties * 8: predictions as age varies prgen age, x(male=0 yr89=1) from(20) to(80) gen(w89) gap(5) rest(mean) label var w89p1 "SD" label var w89p2 "D" label var w89p3 "A" label var w89p4 "SA" label var w89s1 "SD" label var w89s2 "SD or D" label var w89s3 "SD, D or A" * 9: examine predictions list w89x w89s1 w89s2 w89s3 w89s4 in 1/14, clean * 10: plot predicted probabilities graph twoway connected w89p1 w89p2 w89p3 w89p4 w89x, /// title("Panel A: Predicted Probabilities") /// xtitle("Age") xlabel(20(10)80) ylabel(0(.25).50, grid) /// xline(44.93) msymbol(Oh Dh Sh Th) /// xsize(6) ysize(4) name(tmp1, replace) graph export `job'_agepdf.emf, replace * 11: plot cdfs graph twoway connected w89s1 w89s2 w89s3 w89x, /// title("Panel B: Cumulative Probabilities") /// xtitle("Age") xlabel(20(10)80) ylabel(0(.25)1, grid) /// xline(44.93) msymbol(Oh Dh Sh Th) /// xsize(6) ysize(4) name(tmp2, replace) graph export `job'_agecdf.emf, replace /* 12: this needs to be cleaned up! graph combine tmp1 tmp2, col(1) iscale(*.9) imargin(small) /// caption("(`job' `date')", size(tiny)) graph export `job'_agepdfcdf.emf, replace */ // factor change and brant test * 13: factor change listcoef, factor help * 14: percent change listcoef, percent help * 15: brant test of parallel regression assumption brant, detail log close