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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: RE: Combining histograms


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Combining histograms
Date   Mon, 23 May 2011 11:13:34 -0400

Michael Hecker <Hecker.Michael@gmx.de>:
See also -bihist- and -byhist- on SSC.
http://fmwww.bc.edu/repec/bocode/b/byhist.html

On Fri, May 20, 2011 at 6:39 PM, Michael Hecker <Hecker.Michael@gmx.de> wrote:
> Deal Nick,
> thank you very much. This looks like a very good starting point.
>
> Thanks,
> Michael
>
> Am 20.05.2011 20:50, schrieb Nick Cox:
>>
>> "combine", "merge" both admit of different interpretations.
>>
>> You can use -graph combine-. You don't say what you typed or in what sense
>> you "didn't manage to get the result".
>>
>> Otherwise I'll guess that you want to superimpose histograms.
>>
>> You can do that in various ways. Often it's hard work to stop bars of one
>> variable occluding bars of the other variable.
>>
>> sysuse auto, clear
>>
>> twoway histogram trunk, width(2) start(0) bfcolor(none) blcolor(blue) freq
>> || histogram mpg, width(2) start(0) bfcolor(none) blcolor(red) barw(1.7)
>> freq legend(order(1 "`: var label trunk'" 2 "`: var label mpg'"))
>>
>> This is a 19th century way of comparing distributions. -qqplot- gives you
>> a 20th century method with no binning choices or artefacts.
>>
>> Nick
>> n.j.cox@durham.ac.uk
>>
>> Michael Hecker
>>
>> I create two histograms using:
>>
>> hist X, saving(normal, replace)
>> hist Y, saving(changed, replace)
>>
>> Is it possible two merge both gph-files into a single graph?
>> I didn't manage to get the result with "graph combine".
>> I want to have both histograms in a single chart to compare the
>> distributions.
*
*   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