Announcement

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

  • Histogram formatting

    Hello,

    I am trying to format the x axis of a histogram with a specific range. I want to have a bmi percentile variable on the x axis with a custom range from 0 to 5, 5 to 85, and 85 to 100.

    Is there a way to do this or would I have to create 3 separate histograms?

    so far the command I have is:

    histogram bmipct if Grade == "6", bin(494) start(0) frequency

    I tried editing the x axis range with the graph editor but do not see how to make the custom range I want.

    Thanks.
    Last edited by Hillary Acuna; 20 Jan 2023, 14:19.

  • #2
    I don''t follow this. It reads as if you want three bars showing 5, 80 and 15, which should be the percents in bins defined by the 5 and 85% points.

    That seems unlikely, but a general recipe is to bin your variable, calculate frequencies and then show bars directly.

    If that doesn't help (enough), I guess you'll need to give more detail with a data example and more explanation.

    Histograms don't support unequal bin widths, although ,see eqprhistogram from SSC and https://www.stata-journal.com/articl...article=gr0063

    Comment

    Working...
    X