Hi. I need to remove repeating data that are being generated to fill in blanks in a data set. I have several numeric vars and characters that correlate to each X coded (using only a few in the example). Vars D and E below are the ones filling in blanks. The numeric vars are not in any order, including var X. So some ids might have X going from 1 to 10 others only 1 and 2, others 10 and 11 etc X is 1 to to N. Dates repeat and it is okay to repeat, as I need the dates to be linked to each of these variables that are linked to one another. But D and E should be "cleaned" and be only in the first record of each ID. This does not work as I need to keep the repeated Ids. if not first.id then call missing (D, E); Is there a way to remove the duplicates in this case? Thank you! Example ID X A B C D E 1 3 date3 1 ‘character varB1’ 101 ‘character not linked to varB’ 1 3 date 3 2 ‘character varB2’ 101 ‘character not linked to varB’ 1 10 date10 5 ‘character varB5’ 300 ‘character not linked to varB’ 2 1 date1 13 ‘character var13’ 500 ‘character not linked to varB’ 2 1 date1 10 ‘character varB10’ 500 ‘character not linked to varB’ 2 2 date2 10 ‘character varB10’ 700 ‘character not linked to varB’ 2 2 date2 1 ‘character varB1’ 700 ‘character not linked to varB’ 3 10 date10 5 ‘character varB5’ 400 ‘character not linked to varB’ 3 11 date11 6 ‘character varB6’ 600 ‘character not linked to varB’ 3 11 date11 3 ‘character varB3’ 600 ‘character not linked to varB’ Should look like: ID X A B C D E 1 3 date3 1 ‘charactervarB1’ 101 ‘character not linked to varB’ 1 3 date 3 2 ‘character varB2’ 1 10 date10 5 ‘character varB5’ 300 ‘character not linked to varB’ 2 1 date1 13 ‘character varB13’ 500 ‘character not linked to varB’ 2 1 date1 10 ‘character varB10’ 2 2 date2 10 ‘character varB10’ 700 ‘character not linked to varB’ 2 2 date2 1 ‘character varB1’ 3 10 date10 5 ‘character varB5’ 400 ‘character not linked to varB’ 3 11 date11 6 'character varB6’ 600 ‘character not linked to varB’ 3 11 date11 3 'character varB3’
... View more