Hi, I would appreciate help with a small issue. I am working with a dataset of student grades (yscore variable). Each exam observation includes the students grades and details about each student. I want to create a local condition that refers to the grade decile (i.e. if gradedecile==1/if gradedecile==2 etc. ). This is the code I am currently using to generate a decile indicator variable:
Why is the frequency and percentage of each group different? I want yscore to be divided by frequency/percent deciles, and not by grade deciles, therefore the frequency of each group should be identical. I have tried pctile too with no success.
Code:
. xtile decyscore = yscore, nq(10)
. tab decyscore
10 |
quantiles |
of yscore | Freq. Percent Cum.
------------+-----------------------------------
1 | 863,921 14.27 14.27
2 | 465,787 7.69 21.96
3 | 630,105 10.41 32.37
4 | 629,772 10.40 42.77
5 | 769,836 12.71 55.48
6 | 325,334 5.37 60.86
7 | 555,690 9.18 70.04
8 | 713,439 11.78 81.82
9 | 496,215 8.20 90.02
10 | 604,557 9.98 100.00
------------+-----------------------------------
Total | 6,054,656 100.00

Comment