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

st: RE: bar graph of multiple variables


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: bar graph of multiple variables
Date   Sun, 6 Mar 2005 13:41:33 -0600

How about something like this:

sysuse auto

graph bar (count) mpg, over(rep) over(fore)


Scott

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Richard Sherman
> Sent: Sunday, March 06, 2005 12:58 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: bar graph of multiple variables
> 
> Dear statalist,
> 
> Here is what must be a simple graphing problem; I confess that I am
> still mostly baffled by the Stata 8 graphics syntax.
> 
> I have seven variables, c1-c7, that take values 1, 2, or 3.  I want a
> graph of the frequencies of these variables that looks something like
> this:
> 
> 
> freq |
>       |
>       |
>       |  *
>       |  *                        *
>       |  *                        *
>       |  *              *         *
>       |  *  *        *  *         *  *
>       |  *  *  *     *  *  *      *  *  *
>       |________________________________________  (... etc.)
>          1  2  3     1  2  3      1  2  3        (... etc.)
> 
>             c1          c2           c3          (... etc.)
> 
> 
> I have been slogging away with -graph bar- and have gotten no farther
> than the inelegant and unsatisfying method of generating three
> variables from each variable (measuring the count of each category) and
> using
> 
>    graph bar (count) all-of-these-variables
> 
> or
> 
> 
>    graph bar (count) three-at-a-time
> and then
> 
>    graph combine these-seven-graphs
> 
> But surely there is a better way.  Thanks in advance for any help.
> 
> -------------------------------------------------------------------
> Richard Sherman
> Department of Political Science, Leiden University
> Leiden, Netherlands
> http://homepage.mac.com/richard.sherman/
> 
> *
> *   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/


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