Hi,
I'm trying to create a quartile variable of a variable with values ranging from 0 to 11. However, when I create a quartile variable, only 3 categories are represented. Is something about the distribution of the variable causing this?
. tab event
event | Freq. Percent Cum.
------------+-----------------------------------
0 | 33,460 21.15 21.15
1 | 48,246 30.49 51.63
2 | 37,023 23.40 75.03
3 | 21,669 13.69 88.73
4 | 10,602 6.70 95.43
5 | 4,529 2.86 98.29
6 | 1,676 1.06 99.35
7 | 669 0.42 99.77
8 | 224 0.14 99.91
9 | 86 0.05 99.97
10 | 41 0.03 99.99
11 | 14 0.01 100.00
------------+-----------------------------------
Total | 158,239 100.00
. xtile event_q=event,n(4)
. tab event_q
4 quantiles |
of event | Freq. Percent Cum.
------------+-----------------------------------
1 | 81,706 51.63 51.63
3 | 37,023 23.40 75.03
4 | 39,510 24.97 100.00
------------+-----------------------------------
Total | 158,239 100.00
I'm trying to create a quartile variable of a variable with values ranging from 0 to 11. However, when I create a quartile variable, only 3 categories are represented. Is something about the distribution of the variable causing this?
. tab event
event | Freq. Percent Cum.
------------+-----------------------------------
0 | 33,460 21.15 21.15
1 | 48,246 30.49 51.63
2 | 37,023 23.40 75.03
3 | 21,669 13.69 88.73
4 | 10,602 6.70 95.43
5 | 4,529 2.86 98.29
6 | 1,676 1.06 99.35
7 | 669 0.42 99.77
8 | 224 0.14 99.91
9 | 86 0.05 99.97
10 | 41 0.03 99.99
11 | 14 0.01 100.00
------------+-----------------------------------
Total | 158,239 100.00
. xtile event_q=event,n(4)
. tab event_q
4 quantiles |
of event | Freq. Percent Cum.
------------+-----------------------------------
1 | 81,706 51.63 51.63
3 | 37,023 23.40 75.03
4 | 39,510 24.97 100.00
------------+-----------------------------------
Total | 158,239 100.00
Comment