I am writing to understand how I can store the decile values for the following dummy dataset. In this dataset, I have already calculated for two years 1970 & 1971 the decile category in which the variable "pow (power)" belongs - this is stored in pow_dec. I now want to store the corresponding value for each decile rank/category in a separate variable to plot that v/s pow. How can I store the values separately in a new variable?
Code:
egen pow_dec_pc = pctile(pow), p(10) by(year)
input int year float(pow pow_dec)
1970 20 1
1970 23.5 1
1970 22 1
1970 13 1
1970 13 1
1970 22 1
1970 17.5 1
1970 20 1
1970 13 1
1970 23.5 1
1970 19 1
1970 16 1
1970 19 1
1970 22 1
1970 23.5 1
1970 17 1
1970 20.5 1
1970 13 1
1970 20.5 1
1970 20.5 1
1970 17.5 1
1970 17 1
1970 16 1
1970 20.5 1
1970 13 1
1970 22 1
1970 13 1
1970 20 1
1970 16 1
1970 19 1
1970 23.5 1
1970 25 2
1970 25 2
1970 25.5 2
1970 25 2
1970 29.5 2
1970 25.5 2
1970 25 2
1970 25 2
1970 29.5 2
1970 25 2
1970 29.5 2
1970 25 2
1970 29.5 2
1970 25 2
1970 27 2
1970 29.5 2
1970 25 2
1970 26 2
1970 25 2
1970 25 2
1970 28.5 2
1970 29.5 2
1970 25 2
1970 25 2
1970 29.5 2
1970 28 2
1970 29.5 2
1970 29.5 2
1970 25.5 2
1970 29.5 2
1970 33 3
1970 33 3
1970 31 3
1970 33 3
1970 32.5 3
1970 32.5 3
1970 32.5 3
1970 33 3
1970 32.5 3
1970 33 3
1970 31 3
1970 32.5 3
1970 32.5 3
1970 32.5 3
1970 31 3
1970 32.5 3
1970 33 3
1970 31.5 3
1970 31.5 3
1970 31.5 3
1970 32.5 3
1970 33 3
1970 31 3
1970 30.5 3
1970 33 3
1970 40.5 4
1970 40.5 4
1970 40.5 4
1970 37 4
1970 40.5 4
1970 37 4
1970 35.5 4
1970 36 4
1970 40.5 4
1970 39 4
1970 40.5 4
1970 40.5 4
1970 39.5 4
1970 35.5 4
1971 23.5 1
1971 13 1
1971 17.5 1
1971 22 1
1971 25 1
1971 25 1
1971 25 1
1971 19 1
1971 29.5 2
1971 31 2
1971 29.5 2
1971 30.5 2
1971 28.5 2
1970 20 1
1970 23.5 1
1970 22 1
1970 13 1
1970 13 1
1970 22 1
1970 17.5 1
1970 20 1
1970 13 1
1970 23.5 1
1970 19 1
1970 16 1
1970 19 1
1970 22 1
1970 23.5 1
1970 17 1
1970 20.5 1
1970 13 1
1970 20.5 1
1970 20.5 1
1970 17.5 1
1970 17 1
1970 16 1
1970 20.5 1
1970 13 1
1970 22 1
1970 13 1
1970 20 1
1970 16 1
1970 19 1
1970 23.5 1
1970 25 2
1970 25 2
1970 25.5 2
1970 25 2
1970 29.5 2
1970 25.5 2
1970 25 2
1970 25 2
1970 29.5 2
1970 25 2
1970 29.5 2
1970 25 2
1970 29.5 2
1970 25 2
1970 27 2
1970 29.5 2
1970 25 2
1970 26 2
1970 25 2
1970 25 2
1970 28.5 2
1970 29.5 2
1970 25 2
1970 25 2
1970 29.5 2
1970 28 2
1970 29.5 2
1970 29.5 2
1970 25.5 2
1970 29.5 2
1970 33 3
1970 33 3
1970 31 3
1970 33 3
1970 32.5 3
1970 32.5 3
1970 32.5 3
1970 33 3
1970 32.5 3
1970 33 3
1970 31 3
1970 32.5 3
1970 32.5 3
1970 32.5 3
1970 31 3
1970 32.5 3
1970 33 3
1970 31.5 3
1970 31.5 3
1970 31.5 3
1970 32.5 3
1970 33 3
1970 31 3
1970 30.5 3
1970 33 3
1970 40.5 4
1970 40.5 4
1970 40.5 4
1970 37 4
1970 40.5 4
1970 37 4
1970 35.5 4
1970 36 4
1970 40.5 4
1970 39 4
1970 40.5 4
1970 40.5 4
1970 39.5 4
1970 35.5 4
1971 23.5 1
1971 13 1
1971 17.5 1
1971 22 1
1971 25 1
1971 25 1
1971 25 1
1971 19 1
1971 29.5 2
1971 31 2
1971 29.5 2
1971 30.5 2
1971 28.5 2
Rachita
0 Response to Storing decile values correspong to decile rank in a separate variable
Post a Comment