Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: st: Regaining control over axis ranges


From   annoporci <[email protected]>
To   [email protected]
Subject   Re: Re: st: Regaining control over axis ranges
Date   Fri, 28 Dec 2012 18:24:50 +0800

This is not a pressing issue at all, but I'd like to consign here for the
record and in case someone is interested and/or knows how to deal with it.


A short while ago I asked:

I'm trying to shorten the y axis of a graph.

and Nick suggested the solution of omitting data with the -if- and
-inrange- options:

       sysuse ibm,clear
       twoway scatter ibm date if inrange(ibm,-1,+1)

This solution worked well and satisfied me until I experimented with
connected lines instead of scatter points. The -if inrange()- solution
omits the data, with the result that connecting the remaining data is
misleading, especially in a time series context:

       sysuse ibm,clear
       twoway scatter ibm date if inrange(ibm,-1,+1), connect(line)
/// similar thing using tsset:
       tsset date
       twoway tsline ibm if inrange(ibm,-1,+1)

What do I mean by "misleading"? well suppose your data is usually between -1 and 1 but on one occasion (e.g. Black Monday) it is something like -5. If you include the outlier, the rest of the data will look very flattened and the graph won't be informative. If you omit the outlier, the rest of the data will be spread over a greater area and look much clearer but connecting the dots will give the impression that the outlier isn't there at all (since it is omitted).

This is a situation where I would like to be able to "shorten the y axis" (my initial query), as in "zooming" and slicing through connected lines, neither omitting the data nor showing it.


--
Patrick Toche.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index