Announcement

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

  • Bar graph of qSOFA score vs probability of in-hospital mortality

    Dear Statalists,

    I'm working on a prospective cohort study investigating the predictive accuracy of a sepsis score (qSOFA) to predict 30-days in-hospital mortality. The score has four possible values (0–3).
    I want to plot qSOFA score results (0, 1, 2, 3) vs. the proportion of in-hospital morality in a bar chart exactly like the attached image (see below, please).

    My data structures are summarized below.

    Any help would be so appreciated.
    Thanx
    Abdullah


    . dataex qsofa died_30in, count(10)

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(qsofa died_30in)
    0 0
    1 1
    0 0
    1 0
    1 0
    0 0
    1 0
    2 0
    0 0
    0 0
    end
    label values died_30in YesNo
    label def YesNo 0 "No", modify
    label def YesNo 1 "Yes", modify
    ------------------ copy up to and including the previous line ------------------

    Listed 10 out of 2220 observations

    .
    Click image for larger version

Name:	Screen Shot 2022-10-10 at 01.25.52.png
Views:	1
Size:	435.7 KB
ID:	1684912

    Last edited by Abdullah Algarni; 09 Oct 2022, 16:37.
    Sincerely regards,
    Abdullah Algarni
    [email protected]

  • #2
    Here's a start

    Code:
    statsby, by (qsofa) clear: ci proportions died_30in
    twoway bar mean qsofa, barw(0.6) bfcolor("192  181 123") yscale(range(0, .1 )) ylabel(#5) plotregion(margin(0)) ||  rcap lb ub qsofa, leg(off) lcolor(black) xtitle("qSOFA")
    Last edited by Justin Niakamal; 09 Oct 2022, 20:58.

    Comment


    • #3
      Thank you so much, Justin, it works!!
      Would you allow me to acknowledge you upon publication of my research?
      Sincerely regards,
      Abdullah Algarni
      [email protected]

      Comment


      • #4
        Hi Abdullah,

        Admittedly, I don't think I did enough for acknowledgment. You're more than free to acknowledge me, but not required to do so. Most of the active community here posts because we're happy to help where we can!

        Comment

        Working...
        X