Announcement

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

  • Restricting the range of a scatter plot.

    Hi I am trying to restrict the range of a scatter plot of two variables (taxburdenofgdp and religionovernationality) because the plot has an unnecessarily large range in the y-axis when I produce it.
    I looked at the manual and I think it suggested using yscale(range(a b)).
    So my line looks like this:
    graph twoway (lfit taxburdenofgdp religionovernationality) (scatter taxburdenofgdp religionovernationality, mlabel(webname) yscale(range(50)))

    This does not reduce the range at all. Please explain how I can reduce the range on the y-axis so most of the graph isn't just white space with no observations, while the observations are all squished into the bottom.

    Thanks very much.
    Alex

  • #2
    In general, the scale options affect how the axes are labeled, but they don't restrict what's included in the plot. To do that you have to put an -if- condition on your -twoway- statements that excludes points with x or y values outside the range you want.

    But think about this first. If all the observations are squished on the bottom, it must mean that there is one point that has a very high outlying value compared to the rest of the data. Does that point represent an error of some kind, which would warrant its elimination? Or does that observation not really belong to the population of interest? If you can't come up with a good reason to eliminate that point, then you need to reconsider your model, or deal with it in some other way that doesn't suppress the inconvenient truth. For example, the use of a logarithmic scale will spread out the low lying points so that the outlier is closer to the pack.

    Comment


    • #3
      Thanks

      Comment

      Working...
      X