I'd like to drop duplicates randomly instead of just the first duplicate observation.
A snapshot of my data set: Array
Each patent-invt_id has several co_invt_id. I want to keep only one co_invt_id but picked randomly.
I found the following code on the predecessor of statalist:
Code:
bys varnames : gen rnd = uniform() bys varnames (rnd) : keep if _n == 1
0 Response to Dropping duplicates randomly
Post a Comment