Dear all,
I have a question which could not be resolved through the manuals. I am using a program called runmlwin to run a multilevel regression for an ordered categorical outcome. The key quantity of interest is the marginal effect of national economic growth (q_q_growth) on perceptions of the national economy (econGenRetroW5x_rev) at different levels of local economic prosperity (z_wages_year_no_mis_mc); i.e., comparing low-wage to high-wage areas. The runmlwin software does not post results that are manipulable via margins and thus, I am using 'predict' to do the job manually. The regression results being used are in the attached .docx file.
I first thought that I could return results for a 0.1 unit change in q_q_growth by fixing parameters at, for example, 0.2 and 0.1, and taking the difference. So my predictions look like:
But I found the results were sensitive to where I placed the tenth-unit gap, for example, compare the results of a prediction that fixes q_q_growth at 1 and 0.9 using the following code:
(Note that by using cons_2, I'm actually getting STATA to return the probability that R chooses either category 1 (Economy got a lot better) or category 2 (got a bit better) - though I don't think that's too important here.)


I'm not sure why the variation in results would occur, but whatever the case, it isn't ideal for me.
If I had got my predictions from regress, mixed etc, I would simply be able to do something like this, which would return the marginal effect of a one-unit change in q_q_growth on the probability of choosing each response category at a given level of local wages.
Is there something I can do using predict that would similarly estimate a marginal effect in this way, but was valid for the entire range of q_q_growth? After all, I understand from the manual that everything margins does is fundamentally based on STATA using 'predict' behind the scenes.
Thanks for your time.
Here is a data sample, in case it helps understand the structure, and the initial regression input, but this may be obscure for those not versed in runmlwin.
I hope I've given enough information to understand the issue, but please let me know if I can clarify anything further.
I have a question which could not be resolved through the manuals. I am using a program called runmlwin to run a multilevel regression for an ordered categorical outcome. The key quantity of interest is the marginal effect of national economic growth (q_q_growth) on perceptions of the national economy (econGenRetroW5x_rev) at different levels of local economic prosperity (z_wages_year_no_mis_mc); i.e., comparing low-wage to high-wage areas. The runmlwin software does not post results that are manipulable via margins and thus, I am using 'predict' to do the job manually. The regression results being used are in the attached .docx file.
I first thought that I could return results for a 0.1 unit change in q_q_growth by fixing parameters at, for example, 0.2 and 0.1, and taking the difference. So my predictions look like:
Code:
predictnl p12_wages_mar = (invlogit([FP2]cons_2 + [FP5]q_q_growth_1234*.2 + [FP5]z_wages_year_no_mis_mc_1234*z_wages_year_no_mis_mc + [FP5]growth_wages_prod_1234*z_wages_year_no_mis_mc*.2 + [FP5]dummy_wave4_1234)) - /// (invlogit([FP2]cons_2 + [FP5]q_q_growth_1234*.1 + [FP5]z_wages_year_no_mis_mc_1234*z_wages_year_no_mis_mc + [FP5]growth_wages_prod_1234*z_wages_year_no_mis_mc*.1 + [FP5]dummy_wave4_1234)) if _est_egr_nd_pql1==1, ci(p12_wages_mar_lb p12_wages_mar_ub)
Code:
predictnl p12_wages_mar = (invlogit([FP2]cons_2 + [FP5]q_q_growth_1234*1 + [FP5]z_wages_year_no_mis_mc_1234*z_wages_year_no_mis_mc + [FP5]growth_wages_prod_1234*z_wages_year_no_mis_mc*1 + [FP5]dummy_wave4_1234)) - /// (invlogit([FP2]cons_2 + [FP5]q_q_growth_1234*.9 + [FP5]z_wages_year_no_mis_mc_1234*z_wages_year_no_mis_mc + [FP5]growth_wages_prod_1234*z_wages_year_no_mis_mc*.9 + [FP5]dummy_wave4_1234)) if _est_egr_nd_pql1==1, ci(p12_wages_mar_lb p12_wages_mar_ub)
I'm not sure why the variation in results would occur, but whatever the case, it isn't ideal for me.
If I had got my predictions from regress, mixed etc, I would simply be able to do something like this, which would return the marginal effect of a one-unit change in q_q_growth on the probability of choosing each response category at a given level of local wages.
Code:
ologit econGenRetroW5x c.q_q_growth##c.z_wages_year_no_mis_mc margins, dydx(q_q_growth) at(z_wages_year_no_mis_mc=(-2 2))
Thanks for your time.
Here is a data sample, in case it helps understand the structure, and the initial regression input, but this may be obscure for those not versed in runmlwin.
I hope I've given enough information to understand the issue, but please let me know if I can clarify anything further.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float n long id int panoW double q_q_growth float(z_wages_year_no_mis_mc growth_wages_prod) byte(econGenRetroW5x_rev dummy_wave4) 1522050 297 1 0 .19215575 0 . 0 1522052 297 1 .3 -.8778121 -.26334363 4 0 1522054 297 1 .3 -.8778121 -.26334363 . 0 1522059 297 1 .1 .19215575 .019215574 2 0 1522060 297 1 0 .19215575 0 2 0 end label values econGenRetroW5x_rev reveconGenRetroW5x label def reveconGenRetroW5x 2 "Got a little better", modify label def reveconGenRetroW5x 4 "Got a little worse", modify
Code:
runmlwin econGenRetroW5x_rev cons (q_q_growth z_wages_year_no_mis_mc growth_wages_prod dummy_wave2 dummy_wave3 dummy_wave4 dummy_wave6 dummy_wave7 dummy_wave8 dummy_wave10 dummy_wave11 dummy_wave13 dummy_wave14 dummy_wave15 dummy_wave16 dummy_wave17, contrast(1/4)) if estsample_wages_wd_noeu==1, /// level3(panoW: (cons q_q_growth, contrast(1/4))) /// level2(id: (cons, contrast(1/4))) /// level1(n) /// discrete(distribution(multinomial) link(ologit) denominator(cons) basecategory(5) pql1) /// mlwinpath(C:\Program Files\MLwiN v3.05\mlwin.exe) eststo egr_nd_pql1
Comment