Dear statalist community,
I am analyzing a dataset where I want to test different theories that might predict peoples attitudes towards income redistribution. The dataset contains information for six countries and can be divided into different sample subgroups (e.g. by political orientation of respondents). For further details see also my previous post: https://www.statalist.org/forums/for...ultiple-models.
Here is an example dataset:
Recently I observed heterogeneity of effects from e.g. social mobility on attitudes towards income redistribution between sample subgroups (e.g. left-wing voters vs. right-wing voters) and across countries. Then I estimated whether differences between interactions of each left-wing and right-wing voters with social mobility are significant using lincom tests. The code I used is as follows:
I show interaction coefficients for each country in a graph using coefplot. Now I wondered, whether it's possible to display the p-values obtained from the lincom tests in the plot (maybe at the upper bound of the confidence intervals). From the help file I took that p-values from the regression can be displayed by using the mlabel(@pval) command, but I didn't figure out yet how to display p-values from separate lincom tests.
Maybe one knows a way how to do that?
Here is the code for the graph as well:
Thanks for your help, really appreciate it.
I am analyzing a dataset where I want to test different theories that might predict peoples attitudes towards income redistribution. The dataset contains information for six countries and can be divided into different sample subgroups (e.g. by political orientation of respondents). For further details see also my previous post: https://www.statalist.org/forums/for...ultiple-models.
Here is an example dataset:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(ideal_redis soc_mob left_wing right_wing) str5 country_survey 12.100244 2.723296 1 0 "DEU" 6.328649 3.8904226 0 0 "DEU" 11.330771 1.556169 0 0 "DEU" 7.114893 1.556169 0 0 "DEU" 3.5471916 3.50138 0 1 "DEU" 7.25711 1.556169 1 0 "DEU" 6.222379 1.1671268 1 0 "GBR" 1.63697 3.112338 0 1 "GBR" 8.842057 2.3342535 0 1 "GBR" 5.673986 0 0 0 "GBR" 6.382203 0 0 0 "GBR" 17.463827 1.1671268 0 1 "GBR" end label values soc_mob soc_mob label def soc_mob 0 "0 - There is not much opportunity", modify
Code:
foreach country in DEU GBR { reg ideal_redis c.soc_mob#(1.right_wing 1.left_wing) if country_survey=="`country'", robust eststo ideal_redis_`country' lincom 1.right_wing#c.soc_mob - 1.left_wing#c.soc_mob local ir_lc2_`country'_b=`r(estimate)' local ir_lc2_`country'_se=`r(se)' local ir_lc2_`country'_p=`r(p)' }
Maybe one knows a way how to do that?
Here is the code for the graph as well:
Code:
coefplot (ideal_redis_DEU, keep(1.right_wing#c.soc_mob) msymbol(s) msize(small) pstyle(p1) offset(0.15)) /// (ideal_redis_DEU, keep(1.left_wing#c.soc_mob) msymbol(t) msize(small) pstyle(p7) offset(-0.15)) /// /// (ideal_redis_GBR, keep(1.right_wing#c.soc_mob) msymbol(s) msize(small) pstyle(p1) offset(0.15)) /// (ideal_redis_GBR, keep(1.left_wing#c.soc_mob) msymbol(t) msize(small) pstyle(p7) offset(-0.15)) /// /// , aseq swapnames eqrename(ideal_redis_* = "" ) byopts(title("Marginal effects of political orientation by countries")) /// legend(order(2 "Right-wing" 4 "Left-Wing") size(vsmall) col(5) region(lwidth(vthin))) xline(0, lcolor(gs6) lpattern(dash)) /// xmlabel(-2.5(1)2.5, nogrid) xlabel(, grid glcolor(gs14)) ylabel(, grid glcolor(gs14)) ytick(, nogrid) graphregion(color(white)) /// subtitle(, size(medium)bcolor(white) lcolor(white)) plotregion(lcolor(black) margin(vsmall) lwidth(vthin)) bgcolor(white) xsize(5.5) /// mlabel(cond(@pval<.001, "****", cond(@pval<.01, "***", cond(@pval<.05, "**", cond(@pval<.1,"*", "")))))
Comment