Announcement

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

  • Graph with a sample statistic and confidence intervals

    Hello all,

    I am just wondering if the following is possible:

    I have a sample statistic, say, 6.1

    I calculated the 95% confidence interval (I assumed a normal distribution) to be: (5.6; 6.5) based on the size of the sample.

    Now is it possible in Stata to have a graph that has the sample statistic/point estimate (6.1) as a dot, and 5.6 & 6.1 to be lines away from the dot.

    Basically I'm trying to replicate a "skinned" version of a box& whisker plot: http://www.stata.com/manuals13/g-2graphbox.pdf.

    Instead of the median, I'd like the sample statistic (and replace the median line with a dot) with no 25th or 75th quartile so there is no "box". The whiskers would be the lower and upper 95% confidence intervals...

  • #2
    I came across the user-written package -ciplot- which is exactly what I want. However, it is not producing the confidence intervals when I go:

    Code:
    ciplot HazardRatioGraduates100, by(Year)
    That variable is an integer variable, just like the variable used in the user manual for -ciplot-. Why would no CIs be produced?

    Comment


    • #3
      The usual style for confidence intervals is to use twoway scatter for the estimate and twoway rcap for the interval, although twoway spike is (in my view) a tasteful alternative. (The ends of the interval don't seem special...)

      That being so, serrbar is one alternative; or you could use twoway scatteri with recast() as appropriate.

      But if you are going to show an interval why not show some data too? That way lie (e.g.) ciplot (SSC) and stripplot (SSC).

      Last, and far from least here, is Roger Newson's eclplot (SJ/SSC/his own website).

      Comment


      • #4
        Originally posted by Nick Cox View Post
        The usual style for confidence intervals is to use twoway scatter for the estimate and twoway rcap for the interval, although twoway spike is (in my view) a tasteful alternative. (The ends of the interval don't seem special...)

        That being so, serrbar is one alternative; or you could use twoway scatteri with recast() as appropriate.

        But if you are going to show an interval why not show some data too? That way lie (e.g.) ciplot (SSC) and stripplot (SSC).

        Last, and far from least here, is Roger Newson's eclplot (SJ/SSC/his own website).

        Thanks. The first option you mentioned seems to be working fantastically, but will check out the other ones as well.

        Comment

        Working...
        X