Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Construction of family structure variables

    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:

    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
    Thanks

  • #2
    This is not possible with the example data. It may be possible if there is additional information from other variables in the full data set which you have not included in your example.

    Here's why it is not possible. Suppose we have a married male child in the household. The mother in law and father in law would be the parents of said male child's wife. But looking at the classification of relationship-to-head, those in-laws usually do not fit into any of the available categories. The only possibilities would be if the male child's wife is also his cousin, in which case the in-laws would be siblings or siblings-in-law of the head, or if the male child's wife is his sister, in which case the head and the head's spouse would be the in-laws. It is my, perhaps incorrect, understanding that sibling marriages are universally taboo. So what you ask for is only possible in the case of cousin marriages, which in most cultures are uncommon.

    Comment


    • #3
      Hello Clyde,

      I wrote it wrong, I guess. The in-laws are the parents of the married male child and not the wife.

      Comment


      • #4
        Code:
        by common_ID, sort: egen has_married_male_child ///
            = max(relationship_to_head == 3 & Gender == 1)
            
        by common_ID: egen has_father_in_law = ///
            max(has_married_male_child & inlist(relationship_to_head, 1, 2) & Gender == 1)
        by common_ID: egen has_mother_in_law = ///
            max(has_married_male_child & inlist(relationship_to_head, 1, 2) & Gender == 2)
            
        label define in_laws    1    "None present"    ///
                                2    "Father-in-law Only"    ///
                                3    "Mother-in-law Only"    ///
                                4    "Both Present"    ///
                                .n    "N/A (No married son)"
        gen byte in_laws:in_laws = .n if !has_married_male_child
        replace in_laws = 1 if !has_father_in_law & !has_mother_in_law * has_married_male_child
        replace in_laws = 2 if has_father_in_law & !has_mother_in_law
        replace in_laws = 3 if has_mother_in_law & !has_father_in_law
        replace in_laws = 4 if has_mother_in_law & has_father_in_law

        Comment


        • #5
          Thank you, Clyde.

          Comment


          • #6
            Hello, Clyde.

            When the married son is the head of the household (common when when the father is not present in the household or the mother is a widower), how can we arrive at the required variable?

            Comment


            • #7
              This can't be done in this data. The relationship variable does not distinguish between the head's parents and the head's in-laws.

              Comment


              • #8
                Yes, you are right Clyde. I just missed it. Thank you.

                Comment


                • #9
                  Hello, Clyde.

                  If I'm assuming a patrilocal society, then the married son and his wife will be living with the married son's parents. If the married son is the head, then the bold ones under relationship_to_head code 7 "father/mother/father-in-law/mother-in-law" do not apply to him. Likewise, if the married son's wife is the head, the bold ones "father/mother/father-in-law/mother-in-law" do not apply to her. Under this assumption of patrilocality, can you please show me how can I arrive at the family structure variable?

                  Comment


                  • #10
                    Well, based on what you say in #9, there is nothing to compute in this case because if the head is a married son, then father-in-law/mother-in-law does not apply. So we can say that a head that is a married son never has in-laws living in his household.

                    Comment


                    • #11
                      Hello, Clyde. I'm focusing on the in-laws of the married son's wife. Sorry for not making it clear. Your earlier codes provide me with the same, but exclude the cases when married son is the head as the code 7 of the relationship_to_head does not make a distinction between his parents and in-laws. But assuming patrilocality, how can we incorporate the case of the married son as the head in your earlier codes to arrive at the family structure variable?
                      Last edited by Varsha Vaishnav; 30 Nov 2023, 11:47.

                      Comment


                      • #12
                        The following code repeats the original solution and adds to it the case of the in-laws of a married son who is the head of the household.
                        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
                        
                        //    CASE WHERE THE SON OF THE HEAD OF HOUSEHOLD IS MARRIED AND LIVES IN THE HOUSEHOLD
                        by common_ID, sort: egen has_married_male_child ///
                            = max(relationship_to_head == 3 & Gender == 1)
                            
                        by common_ID: egen has_father_in_law = ///
                            max(has_married_male_child & inlist(relationship_to_head, 1, 2) & Gender == 1)
                        by common_ID: egen has_mother_in_law = ///
                            max(has_married_male_child & inlist(relationship_to_head, 1, 2) & Gender == 2)
                            
                        label define in_laws    1    "None present"    ///
                                                2    "Father-in-law Only"    ///
                                                3    "Mother-in-law Only"    ///
                                                4    "Both Present"    ///
                                                .n    "N/A (No married son)"
                        gen byte in_laws:in_laws = .n if !has_married_male_child
                        replace in_laws = 1 if !has_father_in_law & !has_mother_in_law & has_married_male_child
                        replace in_laws = 2 if has_father_in_law & !has_mother_in_law
                        replace in_laws = 3 if has_mother_in_law & !has_father_in_law
                        replace in_laws = 4 if has_mother_in_law & has_father_in_law
                        
                        //    THE CASE WHERE THE HEAD OF HOUSEHOLD IS A MARRIED SON
                        //    IN THAT CASE, HIS SPOUSE'S IN-LAWS ARE HIS PARENTS
                        //    SO WE JUST HAVE TO DETERMINE WHETHER THE HEAD'S FATHER, MOTHER, OR BOTH
                        //    LIVE IN THE HOUSEHOLD
                        by common_ID, sort: egen head_is_married_male ///
                            = max(relationship_to_head == 1 & Gender == 1 & Marital_status == 2)
                        by common_ID, sort: egen head_lives_with_spouse ///
                            = max(relationship_to_head == 2)
                        by common_ID: egen head_lives_with_father ///
                            = max(relationship_to_head == 7 & Gender == 1)
                        by common_ID: egen head_lives_with_mother ///
                            = max(relationship_to_head == 7 & Gender == 2)
                        gen byte wifes_in_laws:in_laws = .n if !(head_is_married_male & head_lives_with_spouse)
                        replace wifes_in_laws = 1 if head_is_married_male & head_lives_with_spouse ///
                            & !head_lives_with_father & !head_lives_with_mother
                        replace wifes_in_laws = 2 if head_is_married_male & head_lives_with_spouse ///
                            & head_lives_with_father & !head_lives_with_mother
                        replace wifes_in_laws = 3 if head_is_married_male & head_lives_with_spouse ///
                            & head_lives_with_mother & !head_lives_with_father
                        replace wifes_in_laws = 4 if head_is_married_male & head_lives_with_spouse ///
                            & head_lives_with_mother & head_lives_with_father
                        Note that in the example data, there are no instances where the spouse of a married son who is head of household has a father-in-law present. This might be an accident of the example data, or it might be systematic. That is, it may be the case that the father-in-law, who would be the son's father, would be considered the head of the household himself, rather than his son being head. I'll leave that to you as it's a sociological, not statistical, matter.

                        Comment


                        • #13
                          I got your point, Clyde. Thank you.

                          Comment

                          Working...
                          X