Hello I am working on a remote dataset.
As seen in the picture
Do you happen to know what I'm doing wrong.
I tried -duplicates drop- on my personal computer with this dummy dataset
As you can see I would like to keep the Bold ones, but instead it drops the last observation for 13 (Unique value) and as request 1 of the duplicates.
As you can see I tried this so you can understand what I want... but of course & isnt allowed
duplicates drop test, force & keep if test2 == 0
Do you know what I'm doing wrong?
I just want to keep the first row for each duplicate therefore converting them to unique values . I can manualy do this, but just wondering out of curiosity what im doing wrong
As seen in the picture
Do you happen to know what I'm doing wrong.
I tried -duplicates drop- on my personal computer with this dummy dataset
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float id str2 id2 float(pessary injection) byte test 12 "1A" 1 1 0 13 "2B" 1 9 1 13 "2B" 1 9 . 13 "2B" 1 4 . end
Code:
duplicates tag (pessary injection id id2), gen(test2) duplicates drop test, force
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float id str2 id2 float(pessary injection) byte(test test2) 12 "1A" 1 1 0 0 13 "2B" 1 9 1 1 13 "2B" 1 9 . 1 13 "2B" 1 4 . 0 end
As you can see I would like to keep the Bold ones, but instead it drops the last observation for 13 (Unique value) and as request 1 of the duplicates.
As you can see I tried this so you can understand what I want... but of course & isnt allowed
duplicates drop test, force & keep if test2 == 0
Do you know what I'm doing wrong?
I just want to keep the first row for each duplicate therefore converting them to unique values . I can manualy do this, but just wondering out of curiosity what im doing wrong
Comment