Announcement

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

  • Graph bar with confidence interval as error bar

    Hello Everyone,
    I have two groups and the outcome is the incidence of chronic pain at 3 and 6 months after surgery. I want to plot a bar chart with a confidence interval as an error bar.
    Please suggest the command to use in STATA.

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(group chronic3_pain chronic6_pain)
    1 1 1
    1 1 1
    2 0 0
    1 0 0
    2 1 1
    1 0 0
    2 0 0
    2 0 0
    1 0 0
    2 1 1
    end
    ------------------ copy up to and including the previous line ------------------
    Last edited by Asish Subedi; 17 Aug 2021, 00:37.

  • #2
    https://stats.idre.ucla.edu/stata/fa...th-error-bars/

    Comment


    • #3
      The combination bar and error bar has various informal names, including dynamite plot, detonator plot and plunger plot. Googling such terms can be enlightening: see for example

      https://simplystatistics.org/2019/02...lots-must-die/

      https://biostat.app.vumc.org/wiki/Main/DynamitePlots


      It is usually simpler to plot a point estimate and a confidence interval. In this case the variable being summarized is evidently an indicator, so for once the mean is informative about the data, except that readers should want to see sample size too.

      Comment


      • #4
        Nick Cox,
        The data I showed has a binary outcome and will be displayed as frequency (proportion).
        Asish

        Comment

        Working...
        X