Announcement

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

  • About boxplot

    Hi,
    I want to make a box plot from which I can see the mean obviously,while I learnd that the
    command
    graph box only show the median of a variable in the box .Is there any possibility to add the mean on the box plot?

  • #2
    This is covered in Section #3 of https://www.stata-journal.com/sjpdf....iclenum=gr0039

    Comment


    • #3
      In addition to Andrew Musau's helpful suggestion, consider also dotplot (official command) and stripplot (SSC).


      Often box plots leave out much detail that could be interesting or useful. Unless the number of categories is more than about 10, there is usually space to show much more helpfully.

      With the stripplot you can do things like this:

      Show all the data as quantile plots.

      Show means as horizontal (or vertical) reference lines.

      Show boxes with medians and quartiles, and here whiskers to 5% and 95% points.

      Code:
      sysuse auto, clear
      ssc install stripplot 
      stripplot mpg, over(foreign) box(barw(0.05)) boffset(-0.1)  pctile(5)  refline cumul vertical xla(, tlc(none)) yla(, ang(h))
      Click image for larger version

Name:	anotherstripplot.png
Views:	1
Size:	29.7 KB
ID:	1537761

      Comment


      • #4
        Thanks

        Comment

        Working...
        X