Dear StataList,
I have a question regarding bin width in histograms.
I cannot manage to create bins of equal width. It seems that Stata automatically adjusts bin widths, even when I explicitly set the width.
This can be seen in the code below (which uses the classic auto data in case one of you is kind enough to try):
clear all
sysuse auto
summarize price
twoway__histogram_gen price ///
, ///
percent width(300) start(3000) ///
gen (frequency bound)
keep bound frequency
order bound frequency
The "bound" variable is the midpoint of the bins, which is not increasing by a constant increment of 300.
Would you know what I am missing here?
My goal is to export the constant bins and corresponding percents to Excel, which is why I use "twoway histogram".
Many thanks for your consideration, and stay healthy.
Best regards,
Marc
Related Posts with Bin widths are not constant in histogram
Multinomial logit model with random effectsDear all, I am working on the data of traffic violations recorded in one year. as shown in the tabl…
Bootstrapped confidence intervalsHello, I have to use bootstrapping to add 90% confidence intervals to a ratio. How could I do that? …
Coefplot merging coefficients of multiple regressions by categoryI am running two regressions with the same independent variable but different dependent variable twi…
Help with graphing results of the synthetic control methodI've been struggling to perform placebo test and finding p-values after running a synthetic control …
-xtivreg with interaction termDear, I am deploying a 2SLS-regression model, including an interaction term of which one of the var…
Subscribe to:
Post Comments (Atom)
0 Response to Bin widths are not constant in histogram
Post a Comment