Dear Statalist users,
I want to analyze the distribution of my variable y by using a histogram. However, as you can see in the attached file "histogram_by_year", it is hardly readable because of a few very strong outliers. First, I have tried to use the following specification to zoom in.
However, this changes the distribution as and is, consequently, not an ideal solution. Next, I found out about twoway__histogram_gen command. I've used the following code:
I specified the width to have 40 bins in each of the graphs, but as you can see in the attached file "histogram_by_year_zoom" the bins get equally divided. How do I have to adjust my code in order to have 40 bins in each of these graphs, while leaving the barwidth the same?
Thank you very much for any help.
Best regards,
Ali
I want to analyze the distribution of my variable y by using a histogram. However, as you can see in the attached file "histogram_by_year", it is hardly readable because of a few very strong outliers. First, I have tried to use the following specification to zoom in.
Code:
histogram y if y < 10000, bin(40) by (year)
Code:
twoway__histogram_gen y, width(250) gen(h x) twoway bar h x if inrange(x,0,10000), barwidth(250) bstyle(histogram) by(year)
Thank you very much for any help.
Best regards,
Ali
Comment