As you can see from the dataset below, I have arranged scores in a descending order. I want a shortlist that has more women than men, so let's say I want to drop lowest n number of observations but they should only be men - how do I do it? Here women are 1 and men are 0
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(scgender score) 1 10 1 9.5 1 9.5 1 8.5 1 8.5 1 8.5 1 8.5 1 8.25 1 8 0 8 0 8 0 8 0 8 1 8 1 8 0 7.75 1 7.75 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 1 6.75 0 6.5 0 6.5 0 6.5 0 6.5 1 6.5 1 6.5 0 6.5 0 6.5 0 6.5 1 6.5 1 6.5 0 6.5 1 6.5 0 6.5 0 6.5 0 6.5 0 6.5 0 6.5 1 6.5 0 6.5 0 6.5 0 6.5 0 6.5 0 6.5 0 6.5 0 6.5 0 6.5 1 6.5 0 6.5 0 6.5 1 6.5 0 6.5 0 6.5 0 6.5 0 6.5 0 6.5 1 6.5 0 6.5 0 6.5 0 6.5 1 6.5 0 6.5 0 6.5 1 6.5 0 6.5 0 6.5 0 6.25 1 6.25 1 6.25 0 6.25 1 6.25 1 6.25 1 6.25 1 6.25 0 6.25 0 6.25 0 6.25 1 6.25 0 6.25 end
0 Response to Dropping lowest n values of a group variable
Post a Comment