Lets say I have multiple table representing 10 countries, and tables contains
Table CountryA Table CountryB user_id | user_score user_id | user_score --------------------- --------------------- 001 | 1245 001 | 1023 002 | 1563 002 | 950 : : : : 1000 | 850 1000 | 1600
What I am trying to do is build a percentile table where each row is for the country and each column is 10th, 20th..
10th, 20th .... 100th countryA score, score .... score
I have started to do this on python, what my question is more related to calculating percentile. At the end I want to know what's the score you need to be getting to be on given percentile. Based on whats given in wikipedia (http://en.wikipedia.org/wiki/Percentile). Using
n = P/100 * N + 1/2 I would get the rank but not the score. Coming back to my problem, IF I were to use this I have to sort the table by score and then use
N and then look which row is tally with the answer that I get from the formula. Is this the correct way to do it?
If the approach is correct, would be better that I write user_id, user_score to csv file and load it in to R, and may be R has a nice function to handle this?