Statalist


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

Re: st: RE: re: the future of statistical computing


From   Eva Poen <[email protected]>
To   [email protected]
Subject   Re: st: RE: re: the future of statistical computing
Date   Mon, 26 Jan 2009 15:44:26 +0000

Tim,

2009/1/26 Mak, Timothy <[email protected]>:
> But I'm sure you can't honestly be happy with leaving out that last observation.
> The issue is not whether it's the last observation or not. It could be in the middle.
> What about Line 2, it has an observation that's within the range. What if I've got
> line 3, 4, 5 as well which all have observations within range. I imagine that you
> might just leave out Line 1's outlying observation, but that's ambiguous - it
> suggests a missing value.

I'm not sure what you mean by ambiguous here. The point is that you
have to tell Stata which observations you want it to graph, using -if-
and/or -in- statements. Thus, what you want can be achieved, and very
transparently so:

gen x1 = _n

twoway (connect y1 x1 if y1 <= 10, lcolor(black) msymbol(oh)) ///
  (connect y21 x1, lcolor(red) msymbol(oh)), ///
  xti("This is the number of days" "since a particular day") ///
  leg(ring(0) pos(10) col(1) lab(1 "Line 1") ///
  lab(2 "Line 2 is really long." "So I'd like to split it into two lines"))

This way, it is perfectly clear which data points you have on the
graph. Leaving out observations in a graph surely should be carefully
considered, and in my opinion Stata does very well in reminding you of
_all_ your data, unless clearly instructed otherwise.

Certainly in my discipline, leaving out error bars because they go
down too far would not be considered very good practice. As the Nature
publication shows, this is handled differently in other disciplines.
However, in your example I find it difficult to make out if the lower
end of the error bar is aligned with the x-Axis or not. Like Maarten
said, the way forward is to create truncated error bars, and therefore
make it absolutely clear to the reader that those are not the original
error bars, if for analytical or cosmetic reasons.

-twoway- so far has not disappointed me in creating my graphs (and I
do plenty, and from time to time quite complicated ones). The book by
Mitchell, as recommended by others, must have been one of my best
purchases in recent years.

Eva
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index