Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: problem with normal curves with histogram , by()


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: problem with normal curves with histogram , by()
Date   Wed, 03 Mar 2004 17:34:04 -0600

Michael Blasnik <[email protected]> has found a problem with the
-normal- option of -histogram- when used with the -by()- option:

> I just tried using histogram with the by option and requesting a normal
> density curve along the lines of:
> 
> histogram myvar if this=1, normal by(groupvar)
> 
> The resulting graphs for each groupvar have normal density curves that
> apparently differ from graph to graph, but they are mostly wrong -- they do
> not come close to the curves drawn when issuing the same command on
> individual groups and they often seem to have nothing to do with the data in
> the plot.  Is this a bug or am I using this incorrectly?

It is definitely a bug.  Looking at the code, the normal densities are all the
same, and are representative of the entire data (within -if- and -in-
conditions) without regard to the -by()- groups.  Basically, the -normal-
option ignores the -by()- option.

I will make it a priority to fix this soon.

--Jeff
[email protected]
*
*   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