Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: more on sts graph, na yscale(log)


From   [email protected] (Jeff Pitblado, Stata Corp.)
To   [email protected]
Subject   Re: st: more on sts graph, na yscale(log)
Date   Wed, 28 May 2003 10:27:49 -0500

Jonathan Sterne <[email protected]> asks about using -yscale(log)-
with -sts graph-.  Jean Marie addressed why this causes a problem.

> > I have to admit that when I looked at a graph that included 0 with the
> > - -yscale(log)- option the first time, I thought that graph was doing
> > something wrong too.  A bit of reflection reveals it is not doing
> > anything wrong, it is handling the mathematical fact that log(0) is
> > negative infinity as best it can.  When you ask graphics to do a
> > - -yscale(log)- plot including 0 on the axis, everything else gets
> > smooshed up to the top, exactly as it should if you actually plotted
> > negative infinity in on your graph.  To negative infinity, all finite
> > numbers look the same.
> >
> > If your data includes 0, the graph is going to include log(0) on the
> > axis; there's no getting around it.
> >
> > Consequently, I think your best option may be to use stphplot.

Jonathan then replied:

> I don't think this is right - it's simply a question of getting the 
> software to start plotting at the first non-zero value of the cumulative 
> hazard in each group specified in the by() option, whenever the yscale(log) 
> option is specified. Jean Marie - if you type:
> 
> version 7.0
> sts graph, by(groupvar) na ylog
> 
> you will find that this is exactly what happens. It was the change to 
> version 8 that introduced the problem.

Actually, under version 7, the -ylog- option of -sts- remaps zeros to .001.
This is currently true for version 8 as well, that is, the -ylog- option is an
undocumented option of -sts- under version 8, and provides the same
functionality as version 7 -sts graph-.

Upon further thought, we have decided that Jonathan's suggestion is not only
supperior, but technically correct.  In a future update, -sts graph- will
"start plotting at the first non-zero value" when supplied with the -ylog- or
-yscale(log)- option.  -ylog- will remain undocumented; it is (will be)
after-all a synonym for -yscale(log)-.

--Jeff
[email protected] 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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