Announcement

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

  • coefplot - add estimates/CI on the graph

    Hi all,

    I have done a graph using the command coeplot below:

    coefplot (variable1, label("Variable 1") mcolor(midgreen) ciopts(lcolor(midgreen)) keep(c.real_age_10_c70#c.variable1_10 c.real_age_10_c70#c.real_age_10_c70#c.variable1_10 ) rename(c.real_age_10_c70#c.variable1_10 = "Variable 1 * cAge" c.real_age_10_c70#c.real_age_10_c70#c.variable1_10 = "Variable 1 * cAge2")) (variable2, label("Variable 2") mcolor(pink) ciopts(lcolor(pink)) keep(c.real_age_10_c70#c.variable2_10 c.real_age_10_c70#c.real_age_10_c70#c.variable2_10 ) rename(c.real_age_10_c70#c.variable2_10 = "Variable 2 * cAge" c.real_age_10_c70#c.real_age_10_c70#c.variable2_10 = "Variable 2 * cAge2")) (variable3, label("Variable 3") mcolor(blue) ciopts(lcolor(blue)) keep(c.real_age_10_c70#c.variable3_10 c.real_age_10_c70#c.real_age_10_c70#c.variable3_10 ) rename(c.real_age_10_c70#c.variable3_10 = "Variable 3 * cAge" c.real_age_10_c70#c.real_age_10_c70#c.variable3_10 = "Variable 3 * cAge2")) (variable4, label("Variable 4") mcolor(orange) ciopts(lcolor(orange)) keep(c.real_age_10_c70#c.variable4_10 c.real_age_10_c70#c.real_age_10_c70#c.variable4_10 ) rename(c.real_age_10_c70#c.variable4_10 = "Variable 4 * cAge" c.real_age_10_c70#c.real_age_10_c70#c.variable4_10 = "Variable 4 * cAge2")) (variable5, label("Variable 5") mcolor(red) ciopts(lcolor(red)) keep(c.real_age_10_c70#c.variable5_10 c.real_age_10_c70#c.real_age_10_c70#c.variable5_10 ) rename(c.real_age_10_c70#c.variable5_10 = "Variable 5 * cAge" c.real_age_10_c70#c.real_age_10_c70#c.variable5_10 = "Variable 5 * cAge2")) (variable6, label("Variable 6") mcolor(midblue) ciopts(lcolor(midblue)) keep(c.real_age_10_c70#c.variable6_10 c.real_age_10_c70#c.real_age_10_c70#c.variable6_10 ) rename(c.real_age_10_c70#c.variable6_10 = "Variable 6 * cAge" c.real_age_10_c70#c.real_age_10_c70#c.variable6_10 = "Variable 6 * cAge2")), xline(0, lwidth(hairline) lcolor(gs14)) xlabel(, labsize(small)) ylabel(, angle(0) labsize(small)) legend(size(small)) msymbol(S) msize(vsmall) graphregion(color(white)) plotregion(color(white)) grid(none).

    I would now like to add, for each coefficient shown in the plot — for example, Variable 1 × cAge and, below it, Variable 1 × cAge², and similarly for all other variables — the corresponding point estimate, 95% confidence interval, and p-value.

    I would like these values to appear in a column on the left-hand side of the graph, aligned with the relevant coefficient estimates. I have already extracted the point estimates, 95% CIs, and p-values from my linear mixed models, but I am struggling to position them correctly on the graph.

    Does anyone know how to add these values in the correct place within a coefplot graph by modifying the above code?

    Thanks so much!
    Laure
    Attached Files

  • #2
    Hi all, does anyone has any idea of how I could add estimates and 95% CI values or actually any text on the left or right side of this plot but aligned with each point for the corresponding values? I need to get this done for a paper which I am currently revising and due for Monday evening. I appreciate any help or advice!

    Thank you all,
    Best, Laure

    Comment


    • #3
      coefplot is from SSC, as you are asked to explain (FAQ Advice #12). Without a reproducible example, I think you are expecting too much from those who may be able to help you. However, if you just need guidance on how to do this, take a look at the online coefplot documentation and examples: https://repec.sowi.unibe.ch/stata/coefplot/markers.html.

      Comment

      Working...
      X