Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: Re: st: catplot problem


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: Re: st: catplot problem
Date   Sun, 11 May 2008 16:57:39 +0100

Tunga Kantarci reported a problem with -catplot bar- on 7 May: 

<http://www.hsph.harvard.edu/cgi-
bin/lwgate/STATALIST/archives/statalist.0805/date/article-287.html>

-catplot- is a user-written program by me available from SSC, and -bar-
is one of its subcommands. Bars were not labelled correctly in some of
his plots. 

Various people have contributed to a diagnosis of the problem. Maarten
Buis pointed out on the list that the problem could not be reproduced
with the auto data and Tunga confirmed that it had bitten him only with
the dataset he was working with. 

Vince Wiggins of StataCorp and I have dug deeper and agree that Tunga
has found a bug. 

The bug is in -graph bar-, not -catplot-: -catplot- with the -bar-
subcommand is a wrapper for -graph bar-.  

The bug is of a perhaps unusual kind, which helps to explain why it has
not surfaced before, to our knowledge. Tunga is using a categorical
variable with several value labels that are just blank spaces. In such
circumstances -graph bar- should ignore the value labels and concentrate
on the underlying integers, but it is not doing that. 

The same bug lurks in -graph hbar- and -graph dot-. 

The bug has been placed on StataCorp's to-fix list. In the mean time,
there is a simple work-around: Don't use value labels like that. Either
drop any value label that is just spaces, or define it to be meaningful.
Either way, your graphs, whether with -graph bar- or -catplot-, should
then be fine. 

Nick                            Vince
n.j.cox@durham.ac.uk            vwiggins@stata.com   


*
*   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