Hi,
I'd like to write some code that selects the 5 biggest firms in a given category. In my mind, it should go something like:
proc sort data=source;
by category size;
run;
proc sql;
create table newtable as select
avg(var1) as var1, avg(var2) as var2, sum(var3) as var3
from source
where (size is in the top 5)
group by category;
quit;
However, I'm not sure what the code to determine if it's one of the biggest 5 observations is. Any ideas?
Thanks!