Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: problem using catplot to graph vertical bars
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: problem using catplot to graph vertical bars
Date
Tue, 26 Oct 2010 13:11:50 +0100
Adelaine is using -catplot- 2.0.0 from SSC. As the FAQ advises
http://www.stata.com/support/faqs/res/statalist.html#stata
"Say what command(s) you are using. If they are not part of official Stata, say where they come from: the STB/SJ, SSC, or other archives."
This is so that people who might answer the question have a much clearer notion of what is being asked -- and so that people who might not answer the question have a chance to learn about something -- and so that people who ask the question get good answers faster.
There are three ways of understanding what is going on here.
1. Logic. If -catplot- understands that -group-, the first thing named, is a variable, then by the same logic -catplot- expects that -bar-, the first thing named, should be a variable. But Adelaine has no such variable, which is precisely why -catplot- complains and issues an error message.
2. Reading the help file. This explains that -recast(bar)- is the option that Adelaine is seeking. Reading the help is often a good idea. Perhaps Adelaine is guessing at appropriate syntax by analogy with -graph bar-, but -catplot- 2.0.0, although calling -graph {bar|hbar|dot}, uses its own syntax.
3. Historical research. Perhaps Adelaine is confusing old and new syntaxes for -catplot-, but they differ. See http://www.stata.com/statalist/archive/2010-06/msg00431.html for one explanation.
Nick
[email protected]
Leung, Adelaine K.W.
I'm trying to make a simple categorical graph using catplot.
The following command works and draws the bars horizonally
catplot group courted if enflp==272 & group!=0 & group!=2 & gal4line==1, percent(courted)
However, I would like the same graphs drawn with vertical bars using the following command:
catplot bar group courted if enflp==272 & group!=0 & group!=2 & gal4line==1, percent(courted)
I get an error: variable bar not found
Any advice will be great!
Thanks in advance.
*
* 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/