Statalist


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

st: RE: RE: RE: RE: use of histogram option


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: RE: use of histogram option
Date   Wed, 29 Apr 2009 21:08:21 +0100

No. -addplot()- applies only to things constructed with -twoway-. 

Notice that I recommended -twoway bar-, which lends itself better to a later -graph combine-. You chose -graph bar- instead. 

As it was Martin Weiss who recommended -graph bar-, over to him to take you further. But -graph combine- can be used: it just may not align your graphs very well. 

Nick 
n.j.cox@durham.ac.uk 

Linn Renée Naper

Thanks.  I just saved the actual means I needed and defined a category variable. Used the bar option, and got almost what I wanted. 
The remaining problem is how to put all three charts into the same "frame". Can't use the by-option as I see it because this require three equal plots just for different categories. 

What I want is to combine the three different plots  given here into one box: 

. graph bar (mean) X1, over(quart)

. graph bar (mean) X2_a (mean) X2_b, over(quart)

. graph bar (mean) X3_a (mean) X3_b, over(quart)


Is there a simple add-plot option for bar charts that could work?

Nick Cox

But also look at -bandplot- from SSC. 

Nick Cox

What you want aren't histograms in Stata's sense, or in the standard statistical sense either. So, don't look to -histogram- or -twoway histogram- commands for these. 

They are all bar charts and -twoway bar- is your best bet at getting them, but each one will need some preparation. 

Linn Renée Naper

I want to use Stata to make some nice histogram showing some distributional features of my data, but unfortunately I have some problems in finding out how to do it.  I've been able to do the following in Excel earlier, but I like the look of the Stata graphics much more, so I hope someone can give me a clue:

Well, I want to use three variable making the histograms. 
The first is an indicator of size for my observations (population size in districts), and the two other variable are a dummy variable and a continuous variable describing the districst.

First; I'd like to make a histogram with five boxes. The first box should simply give me the mean of the dummy variable for all district, whereas the four next should give the mean of the dummy variable within each population quartile of the sample. 
Second I'd like to add another histogram under the first one where I in the same way show the mean of the continuous variable, only here I'd like to categorize the boxes both by population size and the value of the dummy. Thus, the first two boxes should give the mean value of the continuous variable for all districts with dummy value 0 and value 1. The next two should give the same figures for the districts only in the first population quartile, then the second quartile  and so on. I would also be nice if I could add some extra space between the boxes for the total sample, and for the four different quartiles respectively.

*
*   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   |   What's new   |   Site index