// Task 1 routine setup capture log close set more off estimates clear log using cda07c-ex7done.log, replace text version 9.2 set scheme s2mono // pgm: cda07c-ex7done.do // task: 7 - Nominal Outcomes - Excercise // project: CDA Lab Guide // author: your name // date: today's date use sci-review, clear // Task 2: Estimate an MNLM of jobclass on female, enrol, and phd. List the // output from listcoef, help. mlogit jobclass female enrol phd, basecategory(4) nolog listcoef, help // Task 3: Compute the discrete change coefficients with prchange with all // variables held at their mean. Verify the results with prvalue. // Task 3a: use prchange to compute the discrete changes and marginal // effects when all variables are held at their means. prchange, rest(mean) // Task 3b: for one of the variables, verify the computed value of the discrete // change using prvalue. qui prvalue, x(female=0) rest(mean) save label(male) prvalue, x(female=1) rest(mean) diff label(female) // Task 3c: use listcoef to list the coefficients for phd. listcoef phd, help // Task 3d: interpret the effect of phd on jobclass using odds ratio // coefficients. /* Type your answer here A unit increase in the scientist's doctoral prestige increases the odds of having a strong first job relative to a good job by a factor of 1.76, holding other variables constant. A standard deviation increase in the scientist's doctoral prestige increases the odds of having a strong first job relative to a good job by a factor of 1.75, holding other variables constant. */ // Task 3e: use listcoef to list the coefficients for all variables listcoef, help // Task 3f: use mlogview to plot the odds coefficients and discrete changes. // use prchange to set the starting values for mlogview/mlogplot; here I set // the base values to be the mean values of all independent variables. quietly prchange // odds ratio coefficients for phd only mlogplot phd, std(u) p(.1) or sign ntics(9) graph export cda07c-ex7-fig1.emf, replace // discrete changes for female, with standardized coefficients for enroll // and unstandardized for phd. mlogplot female enrol phd, std(0su) p(.1) dc ntics(9) graph export cda07c-ex7-fig2.emf, replace // add discrete changes mlogplot female enrol phd, std(0uu) p(.1) or dc sign ntics(9) graph export cda07c-ex7-fig3.emf, replace // Task 3g: interpret the effects using odds ratio coefficients. /* Type your answer here ** female The odds of having a distinguished first job relative to a good job are .103 times smaller for females than for males, holding all other variables constant. ** enroll The number of years a scientist spent for her/his phd study does not significantly affect the odds of having jobs in various classes of institutions. ** and so on... */ // Task 4: Test the effects of each variable and of whether dependent // categories can be combined. // Task 4a: estimate the MNLM of jobclass on female, enrol, and phd. mlogit jobclass female enrol phd, basecategory(4) nolog // Task 4b: use mlogtest to compute LR tests for each variable. mlogtest, lr // Task 4c: write up the results of the test for phd. /* Type your answer here The effect of Ph.D. prestige on the prestige of the first job is significant at the .01 level. */ // Task 4d: use mlogtest to compute LR tests that categories can be combined. mlogtest, combine // Task 4e: write up your conclusions regarding combining categories. /* Type your answer here The results show that the effects of the independent variables on the outcomes of adequate and good prestige jobs are not jointly significant, suggesting that this categories might be combined. All other tests are significant at the .05 level. */ // SHOW AND TELL: Here is what I'd like you to turn in for a model // that you find interesting. mlogit jobclass female enrol phd, basecategory(4) nolog tab jobclass // turn this in desc female enrol phd // turn this in sum female enrol phd // turn this in prchange // don't turn this in mlogplot phd, std(u) p(.1) or ntics(9) // turn in graph export cda07c-ex7-showandtell1.emf, replace mlogplot female enrol phd, std(0uu) p(.1) or dc sign ntics(9) graph export cda07c-ex7-showandtell2.emf, replace log close exit