Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Drawing histograms


From   Ron�n Conroy <[email protected]>
To   [email protected]
Subject   Re: st: Drawing histograms
Date   Fri, 26 Jan 2007 13:13:11 +0000

On 26 Ean 2007, at 03:04, Lucy @ Mac wrote:


I'd like to graph two categorical variables in one histogram to compared
var1 to var2. What's the best way to do that?
Stata doesn't let you interact with histograms to change the bin width and start values, but packages that do (JMP for instance) can be used to give a scary demonstration. There is a large number of different-looking histograms that can be generated from the same dataset.

When comparing two histograms, there are a number of visual problems

1. Any histogram is a complex shape. Try looking at one and then drawing it from memory. It's difficult. So being able to compare two histograms is hindered by the brain's difficulty seeing a histogram as a whole.
2. Because many different-looking histograms can be drawn from the same data, it is hard to say which differences between a pair of histograms are due to differences in the data and which reflect the vicissitudes of bin width and startpoints.
3. The meaning of the differences observed between two histograms is unclear.

I would try dotplots, with these options

. sysuse auto

. dotplot mpg, over(foreign) median bar cent






=========
Ron�n Conroy
Royal College of Surgeons in Ireland
[email protected]
+353 (0) 1 402 2431
+353 (0) 87 799 97 95
http://www.flickr.com/photos/ronanconroy




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