how can i rank observations within a group? if i use the code: egen rank=group(var1), by(var2). i get an error message saying: egen ... group() may not be combined with by.
is there any other way to get this done?