Dear Sir, I am trying to retrieve value of variables based on other variables.
Example: a dataset with 3 observations: # region_code ill 1 21 4 2 30 10 3 40 6
i have tried the following:
sort region_code gen i s =_n @ill[1]
but i am getting the result of the last observation and not the first.
I will be thankful if you advise on how to retrieve the value of a variable based on record indexing. Sincerely Nada