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

RE: st: histogram

From   "David Harrison" <>
To   <>
Subject   RE: st: histogram
Date   Tue, 22 Feb 2005 12:55:03 -0000

I would suggest you use the command -twoway__histogram_gen- (this is "undocumented", but does have a help file) to generate new variables and then plot them separately, e.g.

sysuse auto, clear
twoway__histogram_gen price, percent gen(h x)
local w=x[2]-x[1]
gen zero=0 if !missing(h)
label var zero "Percent"
twoway rbar h zero x if x<=12000, barw(`w')

Note that this plots all bars from the original histogram (-hist price, percent-) that are centred on a point<=12000 - if you wanted a neat cut at exactly 12000 you would need to specify the -start()- and -width()- options.


*   For searches and help try:

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