Announcement

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

  • manual coefplot with point estimates and significance

    Hi all,
    I would like to show both point estimates and significance in coefplot manually. How can I add point estimates to mlabel in the following command?

    matrix input A = (-0.027, -0.013, 0.008, -0.012, -0.015, -0.014, -0.015, -0.073 \ 0.011, 0.010, 0.013, 0.009, 0.009, 0.013, 0.012, 0.028)
    set scheme s1mono
    coefplot mat(A), se(2) mlabel(cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*", "")))) ///
    rename(c1= "Fruit consumed at least 4 days a week" c2= "Veg consumed at least 4 days a week" c3= "At least 5 servings of fruit & veg a day" ///
    c4= "Alcohol consumed less than 2-3 times a week" c5 = "Binge drinking less than weekly" c6 = "At least 600 MET minutes of physical activity" ///
    c7= "Health index - continuous" c8= "Health index - cutoff") horizontal

    Many thanks
    Karen

  • #2
    coefplot is from SSC (FAQ Advice #12).

    Code:
    clear all
    matrix input A = (-0.027, -0.013, 0.008, -0.012, -0.015, -0.014, -0.015, -0.073 \ 0.011, 0.010, 0.013, 0.009, 0.009, 0.013, 0.012, 0.028)
    set scheme s1mono
    coefplot mat(A), se(2) mlabel(cond(@pval<.001, string(@b)+"***", cond(@pval<.01, string(@b)+"**", cond(@pval<.05, string(@b)+"*", string(@b))))) ///   
    mlabpos(1)  mlabsize(vsmall) ///
    rename(c1= "Fruit consumed at least 4 days a week" c2= "Veg consumed at least 4 days a week" c3= "At least 5 servings of fruit & veg a day" ///
    c4= "Alcohol consumed less than 2-3 times a week" c5 = "Binge drinking less than weekly" c6 = "At least 600 MET minutes of physical activity" ///
    c7= "Health index - continuous" c8= "Health index - cutoff") horizontal
    Res.:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	43.4 KB
ID:	1703346

    Last edited by Andrew Musau; 24 Feb 2023, 11:47.

    Comment


    • #3
      That's brilliant, thank you very much for your help Andrew Musau

      Comment

      Working...
      X