Announcement

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

  • Box plot combined

    Hello,
    I want to make a graph like in the photo( I guess is a box plot with each individual data).
    Can anyone help me?
    Thanks in advance
    Attached Files

  • #2
    Something like that is programmable in Stata, but I can't agree that it's worth emulation.

    1. Jittering as a way to convey individual values is vastly over-sold: the eye and brain are not so good when tasked with computing average local density. You expect the reader to work at the graph?

    2. The box plot is partly obscured by the dot display -- not fatally, but why do that at all?

    3. I can't see the text but the graph caption follows a multitude to do minor evil and doesn't explain the exact box plot convention.

    4. People might be better served by using logarithmic scale.

    I don't have the paper's data, or yours, manifestly, but I faked something loosely similar and fired up stripplot from SSC.

    Here I draw a quantile-box plot intersecting each box with the corresponding quantile function. The convention chosen for whiskers is to extend them to 1 and 99 percentiles, which I think is easier to explain than what still seems to be the most common convention, to show whiskers to the outermost points within 1.5 IQR of each quartile. But other conventions are possible.



    Code:
    clear
    set obs 1613
    gen which = cond(_n <= 124, 1, cond(_n <= 565, 2, 3))
    set seed 314159
    gen what = exp(rnormal(0.11, 0.15)) if which == 1 
    replace what = exp(rnormal(0.13, 0.15)) if which == 2
    replace what = exp(rnormal(0.17, 0.15)) if which == 3
    
    stripplot what, over(which) box centre pctile(1) cumul cumprob vertical
    Click image for larger version

Name:	3groupqbox.png
Views:	1
Size:	46.9 KB
ID:	1744748

    Comment


    • #3
      Thank you very much for your answer!

      Comment

      Working...
      X