Announcement

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

  • X-axis range question

    Hello all,

    What should I do to solve the following problem?

    I am using the xscale option to limit the range of a histogram, but it does not seem to work.

    I read the discussion on the forum, and put one more option, "xla", as suggested in a previous discussion. It did not help.

    Here is how I am generating the histogram:
    histogram Duration, width(5) xscale(range(0 10)) xla(0 10)
    Immediately after issuing the above, I get:
    (bin=48548, start=0, width=5)
    Then I get the following histogram, which is still off from what I want
    Click image for larger version

Name:	pareto.jpg
Views:	1
Size:	51.9 KB
ID:	1723578




  • #2
    You cannot restrict the range of a graph axis in Stata through the xscale or xlabel options. You must do so by using an -if- qualifier in the main part of the command.

    Code:
    histogram Duration if inrange(Duration, 0, 10), width(5) xla(0 10)
    If you read carefully, you will see that the -range()- suboption of -xscale- can be used to "expand range of axis [emphasis added]." It cannot be used to constrain the range.

    Comment


    • #3
      Is duration ever zero in your data? If not, then I would look at the distribution of log duration.

      It seems that you have a very skewed distribution with about 15% in the lowest or next lowest bin (from 0 to 5 or from 5 to 10) and no other bin coming close.

      Comment

      Working...
      X