Hi,
I am trying to find recursive percentiles of data.
I have voting data on proposals. Each proposal has a start date, end date and multiple votes. Each vote has a voting power, which is represented by the personal variable. I want to calculate the 90th percentile of the voting power of votes cast in all previous proposals before the start of the focal proposal. For example, for proposal 136, I want to find the 90th percentile of the voting power of all previously cast votes and place it in front of the proposal 136 votes. For proposal after 136, we should also include all previous votes and including votes cast in proposal 136 and then find the percentile.
Here is my data:
I am trying to find recursive percentiles of data.
I have voting data on proposals. Each proposal has a start date, end date and multiple votes. Each vote has a voting power, which is represented by the personal variable. I want to calculate the 90th percentile of the voting power of votes cast in all previous proposals before the start of the focal proposal. For example, for proposal 136, I want to find the 90th percentile of the voting power of all previously cast votes and place it in front of the proposal 136 votes. For proposal after 136, we should also include all previous votes and including votes cast in proposal 136 and then find the percentile.
Here is my data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(propid voterid votedate startday endday personalvp) 147 3710 22425 22424 22431 178001 136 504 22430 22424 22431 4589.7886 147 647 22424 22424 22431 6000 1668 3521 22425 22424 22431 1414000 136 4363 22424 22424 22431 121889.9 147 4064 22424 22424 22431 159 136 524 22425 22424 22431 110000 136 3052 22426 22424 22431 69 1359 881 22425 22424 22431 16005.003 136 3896 22426 22424 22431 1104002.5 1668 4089 22425 22424 22431 8433.903 1828 881 22424 22424 22431 16005.003 31 3395 22424 22424 22431 4269.1855 147 4252 22424 22424 22431 17034.73 136 3208 22426 22424 22431 2005.8096 227 881 22425 22424 22431 16005.003 93 4350 22424 22424 22431 200.0035 1359 3791 22427 22424 22431 40172 67 2409 22426 22424 22431 6000 93 3791 22427 22424 22431 40172 1668 3565 22426 22424 22431 4182.7217 1668 1661 22425 22424 22431 14682.105 136 3521 22425 22424 22431 1414000 147 546 22425 22424 22431 241.7764 1668 647 22426 22424 22431 6000 67 3551 22425 22424 22431 20190.824 31 472 22431 22424 22431 251.49693 147 2660 22430 22424 22431 36000 147 940 22424 22424 22431 356310 609 3395 22424 22424 22431 4269.1855 end format %td votedate format %td startday format %td endday
Comment