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?
Help!! Data cleaning, creating new variables with observations based on complicated conditionsPlease help me with cleaning this data: below is my data from excel file and I have 1000s of rows …
xtabond2: interpretation of Arellano-Bond test using forward orthogonal deviationsI've been trying to understand the interpretation of the Arellano-Bond test when using FOD for syste…
How to identify that random effect linear model is required over fixed effect linear model?I'm trying to predict a continuous variable using multiple linear regression model including various…
Problem with lpolyci graph using Stata 15 vs 17Hi everybody! I am using Stata 17. While running the code below: HTML Code: sysuse auto, clear …
Renaming variables in loopHello all, I'm working with a dataset which has variables with counters as follows: payment_1, paym…
Subscribe to:
Post Comments (Atom)
0 Response to Curious histogram glitch?
Post a Comment