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

RE: st: RE: Stata graph question


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Stata graph question
Date   Fri, 16 Jul 2004 16:25:23 +0100

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/



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