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?
Psmatch2 standard errorsI have conducted psm using kernel density matching. Since this produces multiple matches i need to a…
Simpson paradox, how to visualize positive tendency when the coefficient doesnt outweigh absolute coefficient of the neg. general tendency?Hi everyone, I would like to have your opinion of the following. I am performing a regression on th…
Expanding Observations on Panel dataI have the following data: Code: * Example generated by -dataex-. To install: ssc install dataex …
Identifying coworkers in spell dataI have a dataset of worker employment spells, and I would like a general way to identify an individu…
Cosinor analysis on iodine dispersionHello stata users, I am trying to perform a cosinor analysis to determine the effect of season on i…
Subscribe to:
Post Comments (Atom)
0 Response to Is it possible to tag duplicates sequentially?
Post a Comment