Hello,
I am relatively new to using STATA and I am having trouble with adding up data in a column when there are duplicates. For instance, I want to add up all the values for HHID 1013000201 (200000 +50000 + 30000). Thank you for any advice!
------------------ copy up to and including the previous line ------------------
Listed 100 out of 16326 observations
Use the count() option to list more
I am relatively new to using STATA and I am having trouble with adding up data in a column when there are duplicates. For instance, I want to add up all the values for HHID 1013000201 (200000 +50000 + 30000). Thank you for any advice!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str12 HHID double total_asset "1013000201" 200000 "1013000201" 50000 "1013000201" 30000 "1013000204" 150000 "1013000204" 80000 "1013000204" 20000 "1013000204" 80000 "1013000204" 10000 "1013000204" 50000 "1013000204" 60000 "1013000204" 300000 "1013000204" 70000 "1013000206" 2500000 "1013000206" 4500000 "1013000206" 340000 "1013000206" 150000 "1013000206" 180000 "1013000206" 1500000 "1013000206" 30000 "1013000206" 150000 "1013000206" 70000 "1013000206" 250000 "1013000210" 300000 "1013000210" 6000000 "1013000210" 10000 "1013000210" 500000 "1013000210" 40000 "1013000210" 2000000 "1013000210" 40000 "1013000210" 850000 "1013000213" 70000 "1013000213" 30000 "101300021302" 15000 "101300021302" 15000 "101300021302" 60000 "101300021302" 30000 "1021000102" 90000000 "1021000102" 6000000 "1021000102" 150000 "1021000102" 800000 "1021000102" 1000000 "1021000102" 1000000 "1021000102" 38000000 "1021000102" 2300000 "1021000102" 2000000 "1021000102" 1200000 "1021000102" 900000 "1021000102" 900000 "1021000108" 50000000 "1021000108" 50000000 "1021000108" 350000 "1021000108" 400000 "1021000108" 250000 "1021000108" 150000 "1021000108" 6000000 "1021000108" 30000 "1021000108" 300000 "1021000109" 15000000 "1021000109" 4000000 "1021000109" 120000 "1021000109" 20000 "1021000109" 190000 "1021000109" 40000 "1021000109" 7000 "1021000109" 200000 "1021000109" 80000 "1021000109" 100000 "1021000110" 20000000 "1021000110" 500000 "1021000110" 25000 "1021000110" 300000 "1021000110" 10000 "1021000110" 40000 "1021000110" 320000 "1021000111" 5000000 "1021000111" 17000000 "1021000111" 65000000 "1021000111" 785000 "1021000111" 220000 "1021000111" 200000 "1021000111" 25000 "1021000111" 90000 "1021000111" 190000 "1021000111" 800000 "1021000111" 100000 "1021000113" 15000000 "1021000113" 55000000 "1021000113" 1.700e+08 "1021000113" 1000000 "1021000113" 15000 "1021000113" 70000 "1021000113" 100000 "1021000113" 40000 "1021000113" 198000 "1021000113" 350000 "1021000201" 2000000 "1021000201" 30000 "1021000201" 15000 "1021000201" 200000 "1021000201" 110000 end
Listed 100 out of 16326 observations
Use the count() option to list more
Comment