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?
Difference of two means significantly different to zeroHey guys, I need your help. So I calculated the mean of 2 groups and then calculated the difference …
Visualising results from multiple regressions - problem with large coefficients (outlier)Dear all, I am currently struggeling with following problem: I want to display the average marginal…
Panel Data reshapeDear all, I have a quick question on how I could reshape my below data into the "long" format? The …
Formatting date from MM/DD/YYYY.I'm trying to format my date but I keep getting a type mismatch error. My dates are labeled as "MM/D…
How come label changes aren't registered by StataHi I just discovered that changes in labels is not captured by either c(changed) or describe (In the…
Subscribe to:
Post Comments (Atom)
0 Response to Is it possible to tag duplicates sequentially?
Post a Comment