I have a dataset with a variable that i need to change anonymise by recoding into a different variable. There are 20,000 entries, some are duplicated so my data looks something like this:
DCD97568
DCD23547
DCD27656
DCD27656
DCD87590
The end product I want is a new variable that looks like this:
DCD00001
DCD00002
DCD00003
DCD00003
DCD00004
Thanks!
Update:
I need to deal with some NA entries in the original variable and I want these to be NA in the new variable so this
DCD14579
DCD21548
NA
DCD79131
DCD79131
DCD12313
would become
DCD00001
DCD00002
NA
DCD00003
DCD00003
DCD00004