Hello everyone,
I have a panel dataset with multiple ID's and Years. So e.g., I have 10 observations for ID_1 in 2014, 8 obs. ID_1 in 2015, etc. I have another variable called "Size_ratio" and I want to keep the best 5 observations per ID and year, meaning the observations for which Size-ratio is closest to "1". Is there any way to do it?
Many thanks in advance.
Beyza
I have a panel dataset with multiple ID's and Years. So e.g., I have 10 observations for ID_1 in 2014, 8 obs. ID_1 in 2015, etc. I have another variable called "Size_ratio" and I want to keep the best 5 observations per ID and year, meaning the observations for which Size-ratio is closest to "1". Is there any way to do it?
Many thanks in advance.
Beyza
Comment