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

Re: st: RE: Rare bug/feature in -graph,ylog-


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Rare bug/feature in -graph,ylog-
Date   Mon, 04 Nov 2002 15:09:29 +0000

At 08:54 04/11/02 -0500, Tom Steichen wrote:
Roger Newson writes (in part):

> I think I have discovered a rarely-encountered bug/feature in
> the Stata -graph- command. (I use the very latest Stata 7
> under Windows 98 SE.) It appears that, if there is only one
> observation in the selected sample, and -ylog- (or -xlog-) is
> specified, and the single y-value (or x-value) is in the open
> interval between one and zero, then -graph- complains of
> non-positive values.

The issue at hand here has to do with Stata setting an automatic
width for the axis when the user does not specify it.  With only
one point, Stata chooses to set the axis width to be 1 unit about
the point, so when the single point is in the (0,1) interval, 0
becomes the lower graphing limit and, thus, the log transform
tries to operate on non-positive values.
However, even if I do specify the axis labels and/or scales, -graph- still complains in the same way:

. list gpm in 1

gpm
1. .0243902

. grap gpm weight in 1,ylog ylab(0.01 0.02 0.03)
nonpositive values encountered
r(411);

. grap gpm weight in 1,ylog ylab(0.01 0.02 0.03) ysc(0.01 0.03)
nonpositive values encountered
r(411);

In these cases, there is no need for Stata to guess default axis widths and to encounter non-positive values.

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk

Opinions expressed are those of the author, not the institution.

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index