Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to plot/organize coefficients (point estimate and 95%CI) from models with different DVs and IVs?

    Dear All,

    I'm trying to produce a coefficient plot using coefplot (or rspike) to organize coefficients and add labels appropriately from 15 regressions looking at 5 different outcome variables and each with 3 different independent variables. My code is the following:
    reg y1 x1 controls,r
    eststo result1_1
    reg y1 x2 controls,r
    eststo result1_2
    reg y1 x3 controls,r
    eststo result1_3

    reg y2 x1 controls,r
    eststo result2_1
    reg y2 x2 controls,r
    eststo result2_2
    reg y2 x3 controls,r
    eststo result2_3

    reg y3 x1 controls,r
    eststo result3_1
    reg y3 x2 controls,r
    eststo result3_2
    reg y3 x3 controls,r
    eststo result3_3

    reg y4 x1 controls,r
    eststo result4_1
    reg y4 x2 controls,r
    eststo result4_2
    reg y4 x3 controls,r
    eststo result4_3

    reg y5 x1 controls,r
    eststo result5_1
    reg y5 x2 controls,r
    eststo result5_2
    reg y5 x3 controls,r
    eststo result5_3

    coefplot (result1_1, offset(-0.38) keep(x1)) (result1_2, offset(-0.33) keep(x2)) (result1_3, offset(-0.28) keep(x3)) ///
    (result2_1, offset(-0.15) keep(x1)) (result2_2, offset(-0.1) keep(x2)) (result2_3, offset(-0.05) keep(x3)) ///
    (result3_1, offset(0.09) keep(x1)) (result3_2, offset(0.135) keep(x2)) (result3_3, offset(-0.09) keep(x3)) ///
    (result4_1, offset(0.3) keep(x1)) (result4_2, offset(0.35) keep(x2)) (result4_3, offset(0.4) keep(x3)) ///
    (result5_1,offset(0.55) keep(x1)) (result5_2,offset(0.6) keep(x2)) (result5_3,offset(0.65) keep(x3)), ///
    vertical ///
    xlabel(, notick labgap(0)) legend(off)

    The graph I got looks like the following. It seems that coefplot grouped by the x variables instead of by outcome variables, i.e., x1 x1 x1 x1 x1 || x2 x2 x2 x2 x2 || x3 x3 x3 x3 x3 instead of x1 x2 x3 || x1 x2 x3 || x1 x2 x3 || x1 x2 x3 || x1 x2 x3 and I don't know how to label my x-axis appropriately
    coefplotbad.png



    I can potentially use rspike but I don't know how to group my coefficients without creating subplots. The end results I want is something as the following graph shows. Many thanks!

    coeffplotsample.jpg
Working...
X