![]() You can check for duplicate observations in Stata in the following ways: The isid command can detect duplicate observations. Apart from dropping duplicates in terms of all variables using duplicates drop, check for duplicates in terms of things you suspect may identify the same person (e. Case 1: Identifying duplicates based on a subset No idea why they do this. I'm interpreting what you wrote as meaning that you would like to drop observations that are duplicates on mergeID but only if the variable cjs takes the value 4. ![]() xls 5 *** search for and drop duplicates isid state // checks if state is unique on each row help duplicates // see options for dealing with duplicates duplicates report state // report any 2 or more rows with the same value for state If they are just duplicates, drop one of each (duplicates command can help with that). ![]() Drop if dup>0 Case 3: Identifying duplicates based on all the variables This should get you all the way there. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |