Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: bar graphs


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: bar graphs
Date   Mon, 9 May 2011 14:54:40 +0100

No; that won't work. -graph bar- syntax is not compatible with -twoway- syntax.

Something more like this?

sysuse auto, clear
local N = _N
preserve
expand 2
replace foreign = 2 if _n > `N'
label def origin 2 "all", modify
graph bar (mean) mpg, over(foreign) over(rep78)
restore

On Mon, May 9, 2011 at 2:41 PM, Oliver Jones
<ojones@wiwi.uni-bielefeld.de> wrote:

> you could try
>
> twoway (graph bar (mean) var_x, over (rural) over(year)) ///
>        (graph bar (mean) var_x, over(year))

Am 09.05.2011 14:54, schrieb Abhimanyu Arora:

>> I need to plot the mean of var_x over a binary categorical variable
>> (urban-rural) and 3 years.
>> When I use the command
>> graph bar (mean)  var_x, over (rural) over(year), I get two bars for
>> each year (one for urban and one for rural).
>> Is it possible to obtain a third bar in addition which would give the
>> overall (across urban-rural) mean of var_x, so as to get 9 bars in
>> all?

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index