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

st: RE: Graphing Frustrations


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Graphing Frustrations
Date   Wed, 20 Aug 2003 00:03:39 +0100

Benjamin Hulley
 
> I think I have an easy question for someone out there.  I 
> have produced  
> a data set by merging several databases and I would like to 
> produce  
> simple summary graphs of some of the variables.  However 
> every time I  
> try to produce a bar graph or histogram I get the following error:
> 
> . graph box drinkalc
> invalid syntax
> invalid syntax
> invalid syntax
> invalid syntax
> invalid syntax
> r(198);
> 
> this particular variable has the following attributes:
> 
> . desc drinkalc
>                storage  display     value
> variable name   type   format      label      variable label
> ------------------------------------------------------------
> ------------ 
> -------
> drinkalc        byte   %8.0g       missingdata
>                                                Ever drink alcohol
> 
> In trying to ferret out the solution I have produced bar graphs  
> successfully from other data sets, including the precursors 
> to the one  
> I am currently using.  In fact, running - graph bar 
> drinkalc - from its  
> precursor produces the correct graph. I've been to the statalist  
> archives and looked up the error code with no luck.  I think I'm  
> missing something obvious, does anyone have a suggestion?

I think you need to say more about -drinkalc-. 

It sounds like a binary variable. 

You say you have problems with bar charts 
and histograms, but your example is for 
-graph box- and I can't reproduce that error message 
even with various near-pathologies (all
values 0 or all values 1 or all values missing). 

Show us the results of 

. tab drinkalc 

Nick 
[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