Statalist


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

Re: st: overlaying two histograms (or distribution curves)


From   Ronan Conroy <rconroy@rcsi.ie>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: overlaying two histograms (or distribution curves)
Date   Tue, 24 Nov 2009 17:20:23 +0000

On 24 Samh 2009, at 15:29, Ariel Linden, DrPH wrote:

That said, there are some audiences that prefer to see something that looks and feels like a histrogram or density curve to see how the distributions overlap (or don't). In this situation, I usually offer up a couple different
methods of visually describing the data.

I know people like something that looks like histograms, but histograms fail one of the fundamental rules of graphics: you shouldn't be able to make two different graphs of the same data.

sysuse auto, clear

histogram mpg, name(Default, replace) title(Default)
histogram mpg, width(5) start(10) name(Bin5Start10, replace) title("Bin 5 Start 10") histogram mpg, width(3) start(10) name(Bin3Start10, replace) title("Bin 3 Start 10") histogram mpg, width(3) start(12) name(Bin3Start12, replace) title("Bin 3 Start 12")
graph combine Default Bin5Start10 Bin3Start10 Bin3Start12

The resulting display shows four histograms of the same variable, all of which look different (and I didn't go to any trouble making up the example - a little fiddling around would produce even more striking differences).

Now: when four histograms of the same data differ by so much, how can anyone tell which of the differences between any two histograms are the result of arbitrary choices of start values and bin widths?



Ronan Conroy
=================================

rconroy@rcsi.ie
Royal College of Surgeons in Ireland
Epidemiology Department,
Beaux Lane House, Dublin 2, Ireland
+353 (0)1 402 2431
+353 (0)87 799 97 95
+353 (0)1 402 2764 (Fax - remember them?)
http://rcsi.academia.edu/RonanConroy

P    Before printing, think about the environment




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