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

Re: st: Question about normal curves and histograms

From (Jeff Pitblado, StataCorp LP)
Subject   Re: st: Question about normal curves and histograms
Date   Mon, 02 Feb 2004 08:48:27 -0600

Joseph McCrary <> asks about the normal density that is
plotted by the -histogram- command:

> end-of-course grades. In the elementary grades, a student could receive one
> of 4 marks. When I add the normal curve to the plot, it begins with the
> midpoint of the first category but ends at the end of the last category. Is
> there a way I can either begin the normal curve at the beginning of the
> first category or end the normal curve at the midpoint of the last category?
> Hereís the code Iím using to generate the graph (STATA 8.2 SE on Windows
> XP):
>        histogram elemlartnum if (gr_jun03_sasi=="01" & elemlartnum>=0 &
> elemlartnum<=3), 
>          discrete frequency normal gap(5)
>          bcolor(ltbluishgray)
>          blcolor(black) blwidth(vvvthin)
>          ylabel(, labels angle(horizontal)) 
>          xlabel(0 "Unsatisfactory" 1 "Satisfactory" 2 "Good" 3 "Excellent")
>          xtitle(First Graders' End-of-Year Language Arts Course Grades) 
>          xscale(titlegap(4))
>          name(G1lartgrades, replace) scheme(s2manual);
>        graph export d:\g1lartgrades.emf;

To which Nick Cox <> replied:

> As indicated in the on-line help, you need
> to specify changes to the rendition of the normal
> density through -normopts-.

> Try your code plus e.g.

> normopts(ra(-0.5 3.5))

> The on-line help is misleading insofar as it implies
> that only the connected line options are pertinent
> here.

Nick makes a good point regarding the on-line help; we will look into
improving the documentation.

As for the original question, it seems more reasonable that the density cover
the range of bars in the histogram.  An update to -histogram- will be
available in a future ado-update.

*   For searches and help try:

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