Dear all, I am handling the expenditure statistics of a city. I have about 1.5K sample, each of which is a household with different household sizes and is grossed up (i.e representing different no. of housholds). They look like these: Serial household size Houshold expense Grossing up factor 0001 3 8064.63 220 0002 3 16830.25 260 0003 6 3755.18 810 0004 3 16028.58 400 0005 3 22617.33 250 0006 2 24844.37 320 0007 2 32191.85 270 0008 2 22815.47 310 0009 3 16298.62 220 0010 2 16850.27 320 For analysis, I have to select the 20% households with lowest expense of different household size. Of course, I have to split the dataset with different household size and sort them according to their expense e.g. for household with household size of 3 Serial household size Houshold expense Grossing up factor 0001 3 8064.63 220 0004 3 16028.58 400 0009 3 16298.62 220 0002 3 16830.25 260 0005 3 22617.33 250 Yet, how can I retain the samples of the lowest 20%, e.g only 0001 and 0004 as (250+260+220+400+220)/5=270 > 220 (0001) and <620 (sum of 0001 and 0004)? So that the dataset will have only the two sample left: Serial household size Houshold expense Grossing up factor 0001 3 8064.63 220 0004 3 16028.58 400 I have think of using the sum of the grossing up factor and the accumulated sum of grossing up factor to do this Serial household size Houshold expense Grossing up factor accumulated sum of grossing up factor 0001 3 8064.63 220 220 0004 3 16028.58 400 620 0009 3 16298.62 220 840 0002 3 16830.25 260 1100 0005 3 22617.33 250 1350 If acccumulated sum > 1350/5 and accumulated sum - grossing up factor >1350/5 then delete. I will get the same result as above. But the point is, how can I extract that 1350 directly from the dataset using SAS command, so that I not need read the result first and input the figure "1350" myself back into the command? remarks: 620 is much large than one fifth of the total no. of households they represent (sum of 250+260+220+400+320) as shown above, but it will neglectable when running the full dataset.
... View more