Note that -separate- was written to make
these separations easier. See [R] separate.
The gain is one command line here, but more
with more categories.
. sysuse auto
. separate mpg, by(foreign)
. graph hbar mpg? mpg, legend(lab(1 "Domestic") lab(2 "Foreign")
lab(3 "Total"))
Nick
[email protected]
Friedrich Huebler
>
> You can generate additional variables for the ten categories. The
> example below shows how to do this with the auto data, using two
> categories plus the total.
>
> . sysuse auto
> . gen mpgd = mpg if foreign==0
> . gen mpgf = mpg if foreign==1
> . graph hbar mpgd mpgf mpg, legend(lab(1 "Domestic") lab(2 "Foreign")
> lab(3 "Total"))
cthompson
> > I am using Intercooled, version 8.2. I am generating a
> > horizontal bar (mean) chart w/ ten bars and I want an eleventh
> > bar to denote the total across the ten categories, e.g. the
> > grand mean.
*
* 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/