Hi,
I use administrative data, where I cannot show the minimum or maximum incomes (and other variables), as this is secret data. Still, I want to find an alternative "maximum" and "minimum".
How can I summarize (like the "sum" code in STATA) my data in a way where I calculate the maximum (minimum) of all variables but BASED ON AN AVERAGE OF THE TOP (BOTTOM) 5 INDIVIDUALS?
Normally, the maximum is simply the one maximum value, but I need this as an average of the top 5 individuals.
Furthermore, my data is panel data, where I observe each individual in a 10-year window. Therefore the top 5 need to be grouped by individuals (and not just the top 5 maximum rows/observations).
Example: What is the mean income of the top 5 persons with the highest income?
Many thanks.
I use administrative data, where I cannot show the minimum or maximum incomes (and other variables), as this is secret data. Still, I want to find an alternative "maximum" and "minimum".
How can I summarize (like the "sum" code in STATA) my data in a way where I calculate the maximum (minimum) of all variables but BASED ON AN AVERAGE OF THE TOP (BOTTOM) 5 INDIVIDUALS?
Normally, the maximum is simply the one maximum value, but I need this as an average of the top 5 individuals.
Furthermore, my data is panel data, where I observe each individual in a 10-year window. Therefore the top 5 need to be grouped by individuals (and not just the top 5 maximum rows/observations).
Example: What is the mean income of the top 5 persons with the highest income?
Many thanks.
Comment