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
Measuring duration between age 13 and 19Hi people, Supposed i want to measure marriage timing among pregnant and non pregnant adolescents (a…
Create a variable to indicate overlappingHello all, I have the dataset as follows. In each observation I have carrier, time(yq), and market(…
Problems with panel dataI am new to stata and I trying to run a regression to understand demographic roles in unemployment, …
How to Keep Duplicated Variables based on the Value of another ColumnHello all! I am working on cleaning up a dataset, and I do not know how to do so. Here are some of …
Query about interaction terms in fixed effects panel dataHi, I have a question about fixed effects panel data interaction terms: Here is my code, xtreg D…
Subscribe to:
Post Comments (Atom)
0 Response to Bin widths are not constant in histogram
Post a Comment