Announcement

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

  • Cutting outliers from qqplots

    Hi,

    I have 5 qqplots and for four of them the x and y axis are from 0 to 2. The fifth qqplot goes from 0 to 10 on the x and y axis, but only a couple of observations are above 2. I would like to make the fifth qqplot so that Stata shows only the data from 0 to 2 and the outliers not, e.g. that the qqplot is cut at 2 on the axis. I tried with
    xscale(r(0 2)) yscale(r(0 2)) but did not succed. Stata showed again on the axis 0 to 10.


  • #2
    To me the main virtue of such a plot is to be honest about the data. so outliers should be shown and should be seen.

    But changing the scale never leads to values being omitted. This is a standard poiint documented at

    Code:
    help axis scale options
    To specify the range of a scale, specify the {y|x}scale(range(numlist)) option. This option specifies that
    the axis be expanded to include the numbers specified.


    ...

    range() never narrows the scale of an axis or causes data to be omitted from the plot. If you
    wanted to graph yvar versus xvar for the subset of xvar values between 10 and 50, typing

    . scatter yvar xvar, xsc(r(10 50))

    would not suffice. You need to type

    . scatter yvar xvar if xvar>=10 & xvar<=50



    Emphasis added to the quotation. So if you really need to do this, using an if qualifier is the way to do it.

    Comment

    Working...
    X