Hello,
I want to construct 3 variables related to family structure: households in which both mother-in-law and father-in-law are present, only mother-in-law is present, and only father-in-law is present. For all three, the in-laws relate to the wife of the married child who is a male. How can I do that?
Example dataset:
Thanks
I want to construct 3 variables related to family structure: households in which both mother-in-law and father-in-law are present, only mother-in-law is present, and only father-in-law is present. For all three, the in-laws relate to the wife of the married child who is a male. How can I do that?
Example dataset:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str32 common_ID str35 ind_id byte(Marital_status Gender relationship_to_head) "TUS10202106201910111901311011001" "TUS10202106201910111901311011001001" 2 1 1 "TUS10202106201910111901311011001" "TUS10202106201910111901311011001002" 2 2 2 "TUS10202106201910111901311011001" "TUS10202106201910111901311011001003" 1 1 5 "TUS10202106201910111901311011001" "TUS10202106201910111901311011001004" 1 2 5 "TUS10202106201910111901311011002" "TUS10202106201910111901311011002001" 2 1 1 "TUS10202106201910111901311011002" "TUS10202106201910111901311011002002" 2 2 2 "TUS10202106201910111901311011002" "TUS10202106201910111901311011002003" 1 1 5 "TUS10202106201910111901311011002" "TUS10202106201910111901311011002004" 1 2 5 "TUS10202106201910111901311011002" "TUS10202106201910111901311011002005" 1 2 5 "TUS10202106201910111901311011003" "TUS10202106201910111901311011003001" 2 1 1 "TUS10202106201910111901311011003" "TUS10202106201910111901311011003002" 2 2 2 "TUS10202106201910111901311011003" "TUS10202106201910111901311011003003" 1 1 5 "TUS10202106201910111901311011003" "TUS10202106201910111901311011003004" 1 2 5 "TUS10202106201910111901311011004" "TUS10202106201910111901311011004001" 2 1 1 "TUS10202106201910111901311011004" "TUS10202106201910111901311011004002" 2 2 2 "TUS10202106201910111901311011004" "TUS10202106201910111901311011004003" 1 1 5 "TUS10202106201910111901311011004" "TUS10202106201910111901311011004004" 1 1 5 "TUS10202106201910111901311011004" "TUS10202106201910111901311011004005" 1 2 5 "TUS10202106201910111901311011005" "TUS10202106201910111901311011005001" 2 1 1 "TUS10202106201910111901311011005" "TUS10202106201910111901311011005002" 2 2 2 "TUS10202106201910111901311011005" "TUS10202106201910111901311011005003" 1 1 5 "TUS10202106201910111901311011005" "TUS10202106201910111901311011005004" 1 2 5 "TUS10202106201910111901311011005" "TUS10202106201910111901311011005005" 1 2 5 "TUS10202106201910111901311011006" "TUS10202106201910111901311011006001" 2 1 1 "TUS10202106201910111901311011006" "TUS10202106201910111901311011006002" 2 2 2 "TUS10202106201910111901311011006" "TUS10202106201910111901311011006003" 1 1 5 "TUS10202106201910111901311011006" "TUS10202106201910111901311011006004" 1 1 5 "TUS10202106201910111901311011006" "TUS10202106201910111901311011006005" 1 2 5 "TUS10202106201910111901311011006" "TUS10202106201910111901311011006006" 1 2 5 "TUS10202106201910111901311011007" "TUS10202106201910111901311011007001" 2 1 1 "TUS10202106201910111901311011007" "TUS10202106201910111901311011007002" 2 2 2 "TUS10202106201910111901311011007" "TUS10202106201910111901311011007003" 1 2 5 "TUS10202106201910111901311011007" "TUS10202106201910111901311011007004" 1 2 5 "TUS10202106201910111901311011007" "TUS10202106201910111901311011007005" 1 2 5 "TUS10202106201910111901311011008" "TUS10202106201910111901311011008001" 2 1 1 "TUS10202106201910111901311011008" "TUS10202106201910111901311011008002" 2 2 2 "TUS10202106201910111901311011008" "TUS10202106201910111901311011008003" 2 1 3 "TUS10202106201910111901311011008" "TUS10202106201910111901311011008004" 2 2 4 "TUS10202106201910111901311011008" "TUS10202106201910111901311011008005" 1 1 6 "TUS10202106201910111901311011008" "TUS10202106201910111901311011008006" 1 2 6 "TUS10202106201910111901311011009" "TUS10202106201910111901311011009001" 2 2 1 "TUS10202106201910111901311011009" "TUS10202106201910111901311011009002" 1 1 5 "TUS10202106201910111901311011009" "TUS10202106201910111901311011009003" 1 2 5 "TUS10202106201910111901311011009" "TUS10202106201910111901311011009004" 1 2 5 "TUS10202106201910111901311011009" "TUS10202106201910111901311011009005" 1 1 8 "TUS10202106201910111901311011010" "TUS10202106201910111901311011010001" 2 1 1 "TUS10202106201910111901311011010" "TUS10202106201910111901311011010002" 2 2 2 "TUS10202106201910111901311011010" "TUS10202106201910111901311011010003" 2 1 3 "TUS10202106201910111901311011010" "TUS10202106201910111901311011010004" 2 2 4 "TUS10202106201910111901311011010" "TUS10202106201910111901311011010005" 1 2 6 "TUS10202106201910111901311011011" "TUS10202106201910111901311011011001" 2 1 1 "TUS10202106201910111901311011011" "TUS10202106201910111901311011011002" 2 2 2 "TUS10202106201910111901311011011" "TUS10202106201910111901311011011003" 2 1 3 "TUS10202106201910111901311011011" "TUS10202106201910111901311011011004" 2 2 4 "TUS10202106201910111901311011011" "TUS10202106201910111901311011011005" 1 1 6 "TUS10202106201910111901311011011" "TUS10202106201910111901311011011006" 3 2 7 "TUS10202106201910111901311011012" "TUS10202106201910111901311011012001" 2 1 1 "TUS10202106201910111901311011012" "TUS10202106201910111901311011012002" 2 2 2 "TUS10202106201910111901311011012" "TUS10202106201910111901311011012003" 1 1 5 "TUS10202106201910111901311011012" "TUS10202106201910111901311011012004" 1 2 5 end label values Marital_status Marital_status label def Marital_status 1 "never married", modify label def Marital_status 2 "currently married", modify label def Marital_status 3 "widowed", modify label values Gender Gender label def Gender 1 "male", modify label def Gender 2 "female", modify label values relationship_to_head relationship_to_head label def relationship_to_head 1 "self", modify label def relationship_to_head 2 "spouse of head", modify label def relationship_to_head 3 "married child", modify label def relationship_to_head 4 "spouse of married child", modify label def relationship_to_head 5 "unmarried child", modify label def relationship_to_head 6 "grandchild", modify label def relationship_to_head 7 "father/mother/father-in-law/mother-in-law", modify label def relationship_to_head 8 "brother/sister/brother-in-law/sister-in-law/other relatives", modify
Comment