I want to calculate total household income in each household. I have tried the following commands. However, the results shown are not correct.
Codes:
bysort ID_H: egen hhsize=count(ID_I)
egen totalincome = total(hhsize), by(J60)
So, How can i work out the total income in each household. And How to display the results in a table so that households can be compared?
ID_I | ID_H | J60 |
1000101 | 10001 | 47000 |
1001201 | 10012 | 53400 |
1002901 | 10029 | 40000 |
1002902 | 10029 | 25000 |
1003501 | 10035 | 32000 |
1003704 | 10037 | 35000 |
1004702 | 10047 | 20000 |
1005602 | 10056 | 40000 |
1005603 | 10056 | 35000 |
1006702 | 10067 | 19000 |
1006901 | 10069 | 29500 |
1007302 | 10073 | 28340 |
1007903 | 10079 | 42700 |
1007911 | 10079 | 35700 |
1008402 | 10084 | 32700 |
1008501 | 10085 | 33000 |
1009511 | 10095 | 23000 |
1010101 | 10101 | 47400 |
1010502 | 10105 | 1500 |
1010702 | 10107 | 40000 |
1010706 | 10107 | 40000 |
1011003 | 10110 | 43000 |
1011102 | 10111 | 47000 |
1011605 | 10116 | 61000 |
1011802 | 10118 | 40000 |
1011903 | 10119 | 25000 |
1012004 | 10120 | 10000 |
1012006 | 10120 | 40000 |
1012301 | 10123 | 12300 |
1012502 | 10125 | 23800 |
1013201 | 10132 | 20000 |
1013901 | 10139 | 28000 |
1015002 | 10150 | 71500 |
1015801 | 10158 | 18000 |
1016102 | 10161 | 16600 |
1017903 | 10179 | 35000 |
1018301 | 10183 | 34320 |
1018401 | 10184 | 21500 |
1018402 | 10184 | 20000 |
1018403 | 10184 | 30650 |
1018601 | 10186 | 45000 |
1019805 | 10198 | 35000 |
1019806 | 10198 | 30000 |
1019903 | 10199 | 30000 |
0 Response to Calculate income household (=the total income of the members) in each household
Post a Comment