Hello everyone,
I use Stata 15 and have to calculate the household income in a panel dataset. For this purpose I have two variables at my disposal:
1.) The individual income of the persons in a household ("inc_ind"). --> One individual value per person.
2.) A variable that captures other income components that are beneficial to the household as a whole, but are not included in the individual income ("inc_hh"). --> The same value for all persons living in the same household.
I want to calculate the total household income by adding the individual incomes of the household members and the variable "inc_hh" of each houshold. However, the variable "inc_hh" should only be taken into account once per household. So if there's more than one person living in a household, "inc_hh" should nevertheless only be included once in the calculation. I hope it becomes clear what I mean...
Furthermore, the two variables should only be added together when both the individual "inc_ind"'s variables and "inc_hh" are nonmissing.
Unfortunately, I haven't found a solution to my problem yet and I really hope that someone can help me here.
Many thanks in advance and best regards!
Tom
I use Stata 15 and have to calculate the household income in a panel dataset. For this purpose I have two variables at my disposal:
1.) The individual income of the persons in a household ("inc_ind"). --> One individual value per person.
2.) A variable that captures other income components that are beneficial to the household as a whole, but are not included in the individual income ("inc_hh"). --> The same value for all persons living in the same household.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double hh_id long p_id double year float(inc_ind inc_hh) 159 1501 2005 73920 40 159 1501 2006 72000 27 159 1501 2007 75000 25 167 1601 2005 15816 1848 167 1603 2005 300 1848 167 1602 2005 4200 1848 167 1602 2006 3600 0 167 1601 2006 16800 0 167 1601 2007 16392 0 167 1602 2007 6120 0 175 1704 2005 34816 1680 175 1701 2005 39288 1680 175 1705 2005 0 1680 175 1705 2006 0 1800 175 1701 2006 43663 1800 175 1704 2006 35880 1800 175 1701 2007 . 1800 175 1704 2007 28200 1800 175 1705 2007 0 1800 end label values hh_id mis label values p_id mis label values year mis
Furthermore, the two variables should only be added together when both the individual "inc_ind"'s variables and "inc_hh" are nonmissing.
Unfortunately, I haven't found a solution to my problem yet and I really hope that someone can help me here.
Many thanks in advance and best regards!
Tom
Comment