Hi Everyone! My data looks like below and I request for any syntax that helps to tag the duplicates sequentially starting from 1, I have highlighted the identified duplicates in a small portion of data. And in the second section, I added a new column where I want the tag for duplicates in a sequential order starting from 1. Thankyou so much in advance!!
* Example generated by -dataex-. For more info, type help dataex
clear
input int(STATEID DISTID PSUID HHID2005 HHID2012 HHSPLITID2005)
2 5 4 1 11 1
2 5 4 1 12 2
2 5 4 2 21 1
2 5 4 2 21 1
2 5 4 3 31 1
2 5 4 4 41 1
2 5 4 5 51 1
2 5 4 6 61 1
2 5 4 6 61 1
2 5 4 6 62 2
2 5 4 7 71 1
2 5 4 8 81 1
2 5 4 8 82 2
2 5 4 8 83 3
2 5 4 9 91 1
2 5 4 10 101 1
2 5 4 11 111 1
2 5 4 12 121 1
2 5 4 13 131 1
2 5 4 14 141 1
2 5 4 14 141 1
2 5 4 15 151 1
2 5 4 15 151 1
2 5 4 15 151 1
2 5 4 15 151 1
2 5 4 16 161 1
2 5 4 16 161 1
2 5 4 17 171 1
2 5 4 17 172 2
2 5 4 18 181 1
2 5 4 19 191 1
2 5 4 20 201 1
2 5 4 20 202 2
2 5 4 21 211 1
2 5 4 23 231 1
2 5 4 23 232 2
2 5 5 1 11 1
2 5 5 2 21 1
2 5 5 2 22 2
2 5 5 3 31 1
2 5 5 4 41 1
2 5 5 5 51 1
2 5 5 5 52 2
2 5 5 6 61 1
2 5 5 7 71 1
2 5 5 8 81 1
2 5 5 9 91 1
end
Wanted an Additional Data column
* Example generated by -dataex-. For more info, type help dataex
clear
input int(STATEID DISTID PSUID HHID2005 HHID2012 HHSPLITID2005) Tag
2 5 4 1 11 1
2 5 4 1 12 2
2 5 4 2 21 1 1
2 5 4 2 21 1 2
2 5 4 3 31 1
2 5 4 4 41 1
2 5 4 5 51 1
2 5 4 6 61 1 1
2 5 4 6 61 1 2
2 5 4 6 62 2
2 5 4 7 71 1
2 5 4 8 81 1
2 5 4 8 82 2
2 5 4 8 83 3
2 5 4 9 91 1
2 5 4 10 101 1
2 5 4 11 111 1
2 5 4 12 121 1
2 5 4 13 131 1
2 5 4 14 141 1
2 5 4 14 141 1
2 5 4 15 151 1 1
2 5 4 15 151 1 2
2 5 4 15 151 1 3
2 5 4 15 151 1 4
2 5 4 16 161 1
2 5 4 16 161 1
2 5 4 17 171 1
2 5 4 17 172 2
2 5 4 18 181 1
2 5 4 19 191 1
2 5 4 20 201 1
2 5 4 20 202 2
2 5 4 21 211 1
2 5 4 23 231 1
2 5 4 23 232 2
2 5 5 1 11 1
2 5 5 2 21 1
2 5 5 2 22 2
2 5 5 3 31 1
2 5 5 4 41 1
2 5 5 5 51 1
2 5 5 5 52 2
2 5 5 6 61 1
2 5 5 7 71 1
2 5 5 8 81 1
2 5 5 9 91 1
end
Related Posts with Is it possible to tag duplicates sequentially?
How to specify family-level option for psmatch2 (my data is at the child-level)Hi everyone, first post so pardon me if I'm making a rookie mistake. I want to compare the differen…
Add lable to binary variableHello. I have a binary variable "size" : 1 means it's small, 0 means it's large. But in my data bas…
Droping outliers based on different criteriaDear all, I use Stata 13 and I want to calculate average value of X removing outliers (1st and 99th…
Synthetic Control Aggregating Data from firm levelMy question is focused on finding the effect of the Brexit vote on the profitability of UK banks. I …
How to deal with a difference in difference fixed effects model with a discrete treatment variable?Hi, I am trying to conduct a fixed effects difference in difference model to estimate the effect of …
Subscribe to:
Post Comments (Atom)
0 Response to Is it possible to tag duplicates sequentially?
Post a Comment