Announcement

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

  • merging one household

    Dear all,

    I am now currently writing my final paper about relations between religiousity and female labor force participation, using STATA 13 and IFLS4. The dependent variable is FLFP. Meanwile, the independent variables are religiousity, residence, female characteristics (age, religion, education, marital status, gender of head household), spouse characteristics (age, income, education) and household characteristics (number of children under six years old and number of children between 6-18 years old). I separate the female characteristics, spouse characteristics and houseold characteristics data.

    I would like to ask some suggestions about some commands of these questions:
    1. How to merge female characteristics, children characteristics and spouse characteristics in one household, if there are more than two husbands and wives in one household? Since I tried to use merge 1:m hhid07 using $dir01\children but it says that variable hhid07 does not uniquely identify observations in the using data. I tried using hhid07 and pid07 however that makes any married couples in the same household will have same number of childrens.
    2. If I use appends, does it work during the regression?

    I am looking forward to get some suggestions regarding my questions. Thank you very much.

  • #2
    Astary (as er FAQ, please nte the prefereence for real full names on this forum. Thanks):
    welcome to the list.
    Q1) what if you retype you Stata code as m:1...;
    Q2) you should -append- your dataset before -regress-ing.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Astary (as er FAQ, please nte the prefereence for real full names on this forum. Thanks):
      welcome to the list.
      Q1) what if you retype you Stata code as m:1...;
      Q2) you should -append- your dataset before -regress-ing.
      Dear Carlo, I have tried using m:1, 1:1 but it does not work.

      Comment


      • #4
        Your problem is not with your understanding of Stata, but rather with your understanding of the IFLS4.

        Like many similar surveys, the sampling units are individuals within households, where a household is simply a group of people sharing the same residence. As you have discovered, households may contain more than one family. Surveys like IFLS4 usually have separate identifiers for individuals within households, and separate variables that give the identifier of the individual's husband or wife, and of the parents of children in the household.

        You need to be looking more closely at the IFLS4 documentation which is available at the IFLS4 data downloads page from which you obtained the IFLS4 data.

        Comment


        • #5
          Originally posted by William Lisowski View Post
          Your problem is not with your understanding of Stata, but rather with your understanding of the IFLS4.

          Like many similar surveys, the sampling units are individuals within households, where a household is simply a group of people sharing the same residence. As you have discovered, households may contain more than one family. Surveys like IFLS4 usually have separate identifiers for individuals within households, and separate variables that give the identifier of the individual's husband or wife, and of the parents of children in the household.

          You need to be looking more closely at the IFLS4 documentation which is available at the IFLS4 data downloads page from which you obtained the IFLS4 data.
          Thank you Mr. William Lisowski,
          I actually have looked and read the given user guide from IFLS. As you can see, there is hhid07 (household identification), pid07 (person identification), pidlink (person identification to link), sex (1=female 0=male), ar14 (line of spouse), ar13 (marital status), ar15b (income)
          For example I wanted to move the husband income data on ar15b on above (the red circle), to the wife data (the pointed dot). I tried make the dummy variable for husband but then I didn't know how to link the pid07 on husband's and ar14 on wife's.

          Could you please help me? Thank you.

          Comment


          • #6
            Please review the Statalist FAQ linked to from the top of the page, especially section 6 on requesting your registration be changed to your full name, and sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata log window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ. Screen captures are not very helpful. To prepare a useful example for you, I'd have to type in the data you posted as a photo.

            With that said, what you need to do is prepare a file of "spouse" data which will include hhid07; p07, which you will rename to something like spouse_p07; and ar15b, which you will rename to something like spouse_ar15b. (You'll sort by hhid07 and spouse_p07 before saving it.) Then in your main file you will generate spouse_p07 = ar14, sort by hhid07 and spouse_p07, then you will merge 1:1 hhid07 spouse_p07 using ... with the previously prepared spouse data. This will add spouse_ar15b to your main file.

            Comment


            • #7
              Originally posted by William Lisowski View Post
              Please review the Statalist FAQ linked to from the top of the page, especially section 6 on requesting your registration be changed to your full name, and sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata log window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ. Screen captures are not very helpful. To prepare a useful example for you, I'd have to type in the data you posted as a photo.

              With that said, what you need to do is prepare a file of "spouse" data which will include hhid07; p07, which you will rename to something like spouse_p07; and ar15b, which you will rename to something like spouse_ar15b. (You'll sort by hhid07 and spouse_p07 before saving it.) Then in your main file you will generate spouse_p07 = ar14, sort by hhid07 and spouse_p07, then you will merge 1:1 hhid07 spouse_p07 using ... with the previously prepared spouse data. This will add spouse_ar15b to your main file.
              Thank you Mr. Willaim Lisowski, it worked with the solutions you gave to me! thank you.

              Comment

              Working...
              X