Hello,
I am working with a longitudinal panel data for households between 2008 and 2011. It would be a sort of hierarchical structure where each year nests households (labeled with the variable hhid), and each household contains each household member (pid).
I am having trouble generating a variable containing the household size for each year. I am able to create a variable that tells me the total number of individuals in the household, but if there are changes in the household composition, this variable does not take it into account. For example, I have a household that in 2008, 2009 and 2010 there are 3 individuals, but in 2011 there are 4, and the variable I create takes the value 4 for all years, instead of 3 for the first 3 years. How do I solve my problem? And if I want to specify the number of adults and the number of children, what do I do? (For this I have an age variable)
I am working with a longitudinal panel data for households between 2008 and 2011. It would be a sort of hierarchical structure where each year nests households (labeled with the variable hhid), and each household contains each household member (pid).
I am having trouble generating a variable containing the household size for each year. I am able to create a variable that tells me the total number of individuals in the household, but if there are changes in the household composition, this variable does not take it into account. For example, I have a household that in 2008, 2009 and 2010 there are 3 individuals, but in 2011 there are 4, and the variable I create takes the value 4 for all years, instead of 3 for the first 3 years. How do I solve my problem? And if I want to specify the number of adults and the number of children, what do I do? (For this I have an age variable)

Comment