// Task 1 routine setup capture log close set more off estimates clear log using cda06c-ex6done.log, replace text version 9.2 set scheme s2mono // pgm: cda06c-ex6done.do // task: 6 - Ordinal Outcomes - Excercise // project: CDA Lab Guide // author: your name // date: today's date use sci-review, clear // Task 2: Since we are familiar with the data set, we will skip the data // cleaning step. // Task 2a: estimate the ordinal logit model; list the coefficients. ologit jobclass female enrol phd, nolog listcoef, std // Task 2b: estimate the ordinal probit model; list the coefficients. oprobit jobclass female enrol phd, nolog listcoef, std // Task 2c: .3 interpret the fully standardized effect of enrol on y* for OLM. /* Type your answer here For a standard deviation increase in enrolled time, the prestige of first job is expected to decrease by .15 standard deviation, holding all other variables constant. */ // Step 2d: What does a standard deviation change in y* mean? // Task 3: Interpretation using the prvalue and prchange commands. // Task 3a: run an OLM of jobclass on female, enrol and phd. ologit jobclass female enrol phd, nolog // Task 3b: use prvalue to compute the predicted probabilities for females // with other variables held at their means; use the save option to save // the predictions. prvalue, x(female=1) rest(mean) save label(female) // Task 3c: use prvalue to compute the predicted probabilities for males // with other variables held at their means; use the dif option to // compare predictions to those for females. prvalue, x(female=0) rest(mean) diff label(male) // Task 3d: compute the discrete and marginal change with variables at // their means. prchange // Task 4 [Optional]: Construct plots of predicted probabilities and // cumulative probabilities as phd changes, other variables at their means. // Task 4.1: estimate the OPM. oprobit jobclass female enrol phd, nolog // Task 4.2: generate predicted probabilities to plot. prgen phd, rest(mean) from(0) to(5) gen(job) n(11) // Task 4.3: plot predicted probabilities: scatter jobp1 jobx, msymbol(Oh) c(l) clc(black) clpa(solid) /// ytitle("Predicted Probabilities for Job Class") ylabel(0(.2)1, grid) /// xtitle("Ph.D. Ranking") xlabel(0(1)5) /// || scatter jobp2 jobx, msymbol(Sh) c(l) clc(red) clpa(solid) /// || scatter jobp3 jobx, msymbol(Th) c(l) clc(green) clpa(solid) /// || scatter jobp4 jobx, msymbol(Dh) c(l) clc(blue) clpa(solid) graph export cda06c-ex6-fig1.emf, replace // Task 4.4: plot cumulative probabilities: scatter jobs1 jobx, msymbol(Oh) c(l) clc(black) clpa(solid) /// ytitle("Predicted Probabilities for Job Class") ylabel(0(.2)1, grid) /// xtitle("Ph.D. Ranking") xlabel(0(1)5) /// || scatter jobs2 jobx, msymbol(Sh) c(l) clc(red) clpa(solid) /// || scatter jobs3 jobx, msymbol(Th) c(l) clc(green) clpa(solid) /// || scatter jobs4 jobx, msymbol(Dh) c(l) clc(blue) clpa(solid) graph export cda06c-ex6-fig2.emf, replace // Task 4.5: describe the effects of phd on jobclass. /* Type your answer here See page 132 of the Sage text. */ // Task 5 [Optional]: Examine the parallel regression assumption. // Task 5.1: create three binary dependent variables. // // dist=1 if jobclass is 4, else 0. // strong=1 if jobclass is 4 or 3, else 0. // adeq=1 if jobclass is 4, 3, or 2, else 0. gen dist=jobclass==4 if jobclass<. label var dist "1=(jobclass=4)" gen strg=(jobclass==4 | jobclass==3) if jobclass<. label var strg "1=(jobclass=4|3)" gen adeq=(jobclass==4 | jobclass==3 | jobclass==2) if jobclass<. label var adeq "1=(jobclass=4|3|2)" // Task 5.2: run three binary logits. logit dist female enrol phd estimates store distmod logit strg female enrol phd estimates store strgmod logit adeq female enrol phd estimates store adeqmod // Task 5.3: run an OLM and compare coefficients to those from the // bianry logits. What would you conclude about the parallel regression // assumption in the ordered logit model? ologit jobclass female enrol phd estimates store ologitmod estimates table distmod strgmod adeqmod ologitmod, /// stats(N chi2 bic) eform b(%6.2f) t(%6.2f) // Task 5.4: use brant to test the parallel regression assumption. ologit jobclass female enrol phd brant log close exit