Hi all, I have a dataset at the person/month/categorical group variable level, like this: ID First name Last name Month Categorical var 1 abc def 200901 a 1 abc def 200902 a 2 abc def 200903 a 3 abc def 200901 b 4 abc def 200902 b I'm trying to clean the ID variable by setting all values of ID within levels of the categorical variable, as the value of ID as of the most recent month. So basically, as long as a person has the same name, I assume they're the same person and overwrite older values of ID (within categorical var=a) with the newest value, like this: ID First name Last name Month Categorical var 2 abc def 200901 a 2 abc def 200902 a 2 abc def 200903 a 4 abc def 200901 b 4 abc def 200902 b So basically, I want to retain all the same data, but with ID now consistent within each level of categorical var for each person. Any help is much appreciated.
... View more