The main idea was that of Toyoto, who was
careful enough to plot frequencies as bars
and to convert probabilities to estimated
frequencies.
Thanks to Bill for the flag that -w(0.5)-
has a side-effect in density calculation,
exactly as it should be for continuous variables,
but not what is wanted here. Better code would be
. twoway histogram n [fw=freq] , discrete fraction w(0.5) || line p n
With the -fraction- option, -w()- is reduced to cosmetic
tuning of bar width.
Nick
[email protected]
Bill Rising
> On Jul 16, 2004, at 6:05, Nick Cox wrote:
>
> > An alternative (with Toyoto's data) could be
> >
> > twoway histogram n [fw=freq] , discrete w(0.5) || line p n
> >
>
> This is really nice, but I think that the w(0.5) adds an artifact: it
> doubles the values for observed relative frequencies. This makes for
> some probabilities which are bigger than 1!
>
> Otherwise, it makes for a pretty cool graph. Good tip.
*
* 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/