I am trying to identify cases that are duplicates on two variables "agencyname" and "statefips" but have distinct values on a third variable "agencyid".
I used the code
Code:
duplicates tag agencyname statefips, gen(agencydup)
On an unrelated note, for identifying duplicate cases, could someone please explain to me the difference between the following 3 lines of code. I was told to use the last one for identifying duplicates but do not know what they are doing differently.
Code:
egen dup= tag(agencyname statefips)
Code:
duplicates tag agencyname statefips, gen(dup)
Code:
bys agencyname statefips: gen dup = cond(_N == 1, 0, _n)
Tom
0 Response to Reporting duplicates on two variables that are not duplicates on a third variable
Post a Comment