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

st: RE: Re: "total" bar for bar chart


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: "total" bar for bar chart
Date   Wed, 21 Jul 2004 14:38:44 +0100

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index