Announcement

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

  • Adding vertical lines to eqprhistogram

    I have data on income and would like to graph its distribution. It seems the eqprhistogram command works better than the regular histogram since it's easier for the eye to distinguish income groups (e.g. centiles, quintiles). I would also like to add vertical lines to represent government mandated thresholds (these do not necessarily align with the income group markers) with vertical lines. Is there a way to overlay vertical lines *on top* of the eqprhistogram?

    I tried:
    eqprhistogram income, bin(10) xline(a b)

    In this case, the xlines lay *beneath* the histogram. eqprhistogram doesn't work with "graph twoway" either.

    Any suggestions? Thanks!


  • #2
    eqprhistogram is from SSC, as you are asked to explain. FAQ Advice #12 applies.

    It is an application of graph twoway, so I don't know what you mean there. It's not a graph twoway type, clearly. You don't give a code example with data that leads you to say that. FAQ Advice #12 again.

    This shows some technique. See also

    SJ-16-3 gr0067 . Speaking Stata: Shading zones on time series and other plots
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
    Q3/16 SJ 16(3):805--812 (no commands)
    discusses background shading of time series and other plots


    Code:
    sysuse auto, clear 
    eqprhistogram mpg, bin(7) plot(scatteri 0 20 0.15 20, recast(line) || scatteri 0 30 0.15 30, recast(line)) legend(off) xtitle("`: var label mpg'") ytitle(Density)
    Click image for larger version

Name:	eqprhistogram.png
Views:	1
Size:	18.0 KB
ID:	1431541

    Comment


    • #3
      Nick, thank you so much for your help!
      Sorry I didn't provide a reproducible example and wasn't clear with the commands I used. I will also take a look at the article.

      Comment

      Working...
      X