Hi Everyone,

I am looking for some help to calculate the cumulative percentages for a panel data.

Code:
         year         id   income
 2001    1    34   
2001    1    34    
2001    1    34    
2001    2    45    
2001    2    45    
2001    2    45   
2002    1    23   
2002    1    23   
2002    2    67    
2002    2    67    
2002    2    67    
2002    2    67
This is a panel data sorted by the year and the id. The income is the mean income of all the individuals with a particular id. For example, in 2001, the mean income for all the individuals with id 1 is 34.

The result should be like this:
Code:
Year    Id    income    Rank    Frequency    cumfreq    cummPercentage
2001    1    34    2    3    3    50
2001    1    34    2    3    3    50
2001    1    34    2    3    3    50
2001    2    45    1    3    6    100
2001    2    45    1    3    6    100
2001    2    45    1    3    6    100
2002    1    23    2    2    2    33
2002    1    23    2    2    2    33
2002    2    67    1    4    6    100
2002    2    67    1    4    6    100
2002    2    67    1    4    6    100
2002    2    67    1    4    6    100
Please note that since this is a panel data, I need the cumulative percentages for each year.

I have gone through some informative threads on related topics, but most of them demonstrate for cross sectional data. I could not find anything on panel data.

I would appreciate any help.

Thanks a ton,

J