Array I can't find this reported before, and I am pretty sure it's NOT my data.
Array
Above, the relevant bits. Age is an integer variable taking on values in [0, 120].
At the extreme end of the distribution, there are 8 cases aged 111 or older.
NOW. if I plot a histogram of this:
hist age if age > 110, w(1) freq (i.e with unit bins), I get the following, where the 4 elements at 120 are plotted as if they are 119.
Array
SAY WHAT?
And this happens with other variables in the same data set: the final category gets (arbitrarily) combined with the PENULTIMATE category, even if one specifies w(1). Unfortunately data are sensitive, but here is a largely meaningful demo:
The below is a tabulate of frequencies of deaths by date of death in recent weeks for some population. Note the 111 at 24 and 25 jul; the 110 at 26 jul; and the most recent numbers of 94 and 62.
Array
Plotting a histogram of the same, and suddenly the data for 27 July reflect 156 (being 94 + 62)
Array
Related Posts with Curious histogram glitch?
Code to be able identify treated-control firm(s) groups for matched dataHi I have a matched treated-control firm-year panel dataset which I matched on different variables …
significance of difference in coefficients of same regression modelHi, I am having a question regarding testing whether the difference of coefficients is significant.…
Question about time series data with multiple factorsI am trying to format my data to allow me to designate it as time series and use the lag and lead op…
Create a new variable that shows the result of tabulationHello Statalist, I consider myself a beginner, so I would appreciate your help, and thank you for t…
Interrupted time series with multiple treatment periodsI am working on a sugar tax evaluation, using an interrupted time series model that accounts for two…
Subscribe to:
Post Comments (Atom)
0 Response to Curious histogram glitch?
Post a Comment