Announcement

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

  • Checking for Missing Head of Houshold within a household

    Hello, I have a data set on household survey where the household size, member of the household number, Age, Date of Birth, Relationship to the Head of the household and their Gender. Sample shown below:
    HHSIZE MNO SEX RELATIONSHIP DOB AGEY
    2 02 2 2 11-03-1978 40
    2 01 1 1 22-02-1968 50
    7 03 1 3 14-05-2008 10
    7 02 2 2 28-03-1978 40
    7 01 1 1 11-05-1968 50
    7 06 1 3 16-02-2010 8
    7 07 1 3 14-02-2006 12
    7 04 1 3 10-05-2009 9
    7 05 1 3 14-05-2008 10

    Key: In Relationship 1=Head of Household(HHH), 2=Spouse to HHH, 3=Child to HHH.
    In HHSize 2=there are only two members in the household, 7=there are 7 members with that household
    In MNO 01= 1st position as Head of Household, 02= 2nd position & Spouse to HHH, 03=3rd position, etc..
    In SEX 1= Male and 2= Female

    Questions:
    1. What command can I use to check for Missing Head within a Household?
    2. What command should I use to verify if the number of occurrence of House Size (HHSIZE) tally with number of occurrence of the Member of Household (MNO)


  • #2
    Not sure about your second question, but regarding the first, the code i use more often than not is:
    Code:
    bysort hhid:egen aux=sum(rel==1)
    assuming hhid is the household identifier, and that rel is coded 1 to identify the head of the household.
    HTH
    Fernando

    Comment


    • #3
      Fernando Rios gives excellent advice. For more in the same vein see https://www.stata.com/support/faqs/d...ble-recording/

      Note incidentally while the egen function sum() is not documented as from Stata 9, it will still work. total() is entirely equivalent.

      Comment


      • #4
        FernandoRios Thanks for the idea however, the code only count the Head of households from the members of the households see below result
        aux | Freq. Percent Cum.
        ------------+-----------------------------------
        0 | 35,730 82.65 82.65
        1 | 7,501 17.35 100.00
        ------------+-----------------------------------
        Total | 43,231 100.00
        which is also the same result if I use the count code . count if RELATIONSHIP==1 7,501. Now, I deleted some head of household out of the data and run the code to see if it will identify that within a household there are missing heads , unfortunately, it only count it and that was all.

        What I really want is to get a code that can identify a missing head within a Household and not only counting it.




        Comment


        • #5
          Originally posted by FernandoRios View Post
          Not sure about your second question, but regarding the first, the code i use more often than not is:
          Code:
          bysort hhid:egen aux=sum(rel==1)
          assuming hhid is the household identifier, and that rel is coded 1 to identify the head of the household.
          HTH
          Fernando
          The second question is similar to the first, but having the thought that the second is a kind of a way confirming second level consistency check to ascertain missing heads within a household.

          Comment


          • #6
            What you describe is really unusual. In the data example you show, I didn’t see a household identifier..
            can you show another data example showing hhid and relationships variable?

            Comment


            • #7
              What you describe is really unusual. In the data example you show, I didn’t see a household identifier..
              can you show another data example showing hhid and relationships variable?
              Fernando

              Comment


              • #8
                Originally posted by FernandoRios View Post
                What you describe is really unusual. In the data example you show, I didn’t see a household identifier..
                can you show another data example showing hhid and relationships variable?
                Fernando
                Ok , sorry, you make use of the below:
                HHID HHSIZE MNO SEX RELATIONSHIP DOB AGEY
                NE/GO/KWM/ZEGO/1/001/02 2 2 2 2 11-03-78 40
                NE/GO/KWM/ZEGO/1/001/01 2 1 1 1 22-02-68 50
                NE/GO/KWM/ZEGO/1/001/03 7 3 1 3 14-05-08 10
                NE/GO/KWM/ZEGO/1/001/02 7 2 2 2 28-03-78 40
                NE/GO/KWM/ZEGO/1/001/01 7 1 1 1 11-05-68 50
                NE/GO/KWM/ZEGO/1/001/06 7 6 1 3 16-02-10 8
                NE/GO/KWM/ZEGO/1/001/07 7 7 1 3 14-02-06 12
                NE/GO/KWM/ZEGO/1/001/04 7 4 1 3 10-05-09 9
                NE/GO/KWM/ZEGO/1/001/05 7 5 1 3 14-05-08 10

                Where the HHID is alphanumeric. The relationship variable has 3 as a child to the head to the Household, while 2 stands for spouse to the Head and 1 = head of the household.

                Comment


                • #9
                  Alright,
                  However, at least for the small example, every person has a different HHID. That is why the code i suggested is simply counting the number of "heads of the households"

                  Comment


                  • #10
                    Originally posted by FernandoRios View Post
                    Alright,
                    However, at least for the small example, every person has a different HHID. That is why the code i suggested is simply counting the number of "heads of the households"
                    So, there is no code to really find out if there are missing Heads with a household?

                    Comment


                    • #11
                      Well
                      if you can’t identify which observations are part of the same household, you can’t identify if a household has or doesn’t have a head of housebold

                      Comment


                      • #12
                        Originally posted by FernandoRios View Post
                        Well
                        if you can’t identify which observations are part of the same household, you can’t identify if a household has or doesn’t have a head of household
                        Okey, let me explain, IN the HHSIZE, the 2=there are two members in that household while 7=there are seven members of a household, each one has its unique MNO, so from the above sample, there are only two household in the data set. Hope you understand now.

                        Comment


                        • #13
                          Originally posted by Nick Cox View Post
                          Fernando Rios gives excellent advice. For more in the same vein see https://www.stata.com/support/faqs/d...ble-recording/

                          Note incidentally while the egen function sum() is not documented as from Stata 9, it will still work. total() is entirely equivalent.
                          So, there is no code to really find out if there are missing Heads with a household?

                          Comment


                          • #14
                            Hi Gideon
                            So, is there a way to find households with missing heads? Yes it seems possible. based on your post in #8, i can see some patterns regarding the Household id and members. However, its hard to make any generalization.
                            My suggestion is to go back to the survey manual and codebook, or based on the data, and figure out how to uniquely identify households. That will require better knowledge of your data. It will be hard for anyone to give you better answers unless they are familiar with your data.
                            Fernando
                            Last edited by FernandoRios; 30 May 2019, 11:06.

                            Comment


                            • #15
                              Originally posted by FernandoRios View Post
                              Hi Gideon
                              So, is there a way to find households with missing heads? Yes it seems possible. based on your post in #8, i can see some patterns regarding the Household id and members. However, its hard to make any generalization.
                              My suggestion is to go back to the survey manual and codebook, or based on the data, and figure out how to uniquely identify households. That will require better knowledge of your data. It will be hard for anyone to give you better answers unless they are familiar with your data.
                              Fernando
                              Okey, from the data-set, there are basically two households, household of 2 members, and household 7 members, now, should there be a missing head=1 in a any of the household, what command will one use to identify that particular household do not have a head within that household.

                              Comment

                              Working...
                              X