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 (Jeff Pitblado, StataCorp LP)
Subject   Re: st: problem with normal curves with histogram , by()
Date   Wed, 03 Mar 2004 17:34:04 -0600

Michael Blasnik <> 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.

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index