Announcement

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

  • #16
    Dear Mr Schechter,
    This is exactly what I am looking for, except the fact that for parental education and income at the end of the data set, do not show anything but dots (no data). I ran the code you showed above.
    Do you know what I am doing wrong ?
    Thank you in advance,
    Jord

    Comment


    • #17
      You are not doing anything wrong. It's my error. In the -merge- command, I specified that only matched observations would be kept: but that eliminates the information about the parents! So the solution is to change that to keeping both the matched observations and all observations originally in the household data set. It is also necessary to not -drop- the observations with birthweight missing, because that, too, obliterates parental information. With those removed, and with the removal of observations with missing birthweights postponed to the end of the process, we get, I believe, the results you want.

      Code:
      use child_data, clear
      clonevar link = HHX_Child
      tempfile holding
      save `holding'
      
      use household_data, clear
      clonevar link = HHX_Family
      merge m:1 link FPX using `holding', keep(match master) nogenerate keepusing(birth_weight HHX_Child)
      
      //  NOW REDUCE DATA TO ONE OBS PER CHILD, BRINGING INTO THAT OBS THE PARENTS'
      //  EDUCATION AND INCOME
      foreach v of varlist Education_level Total_earnings_year {
          by HHX_Family, sort: egen mom_`v' = max(cond(Sex == 2 & missing(Relation_dad) & missing(Relation_mom), ///
              `v', .))
          by HHX_Family: egen dad_`v' = max(cond(Sex == 1 & missing(Relation_dad) & missing(Relation_mom), ///
              `v', .))
      }
      keep if !missing(Relation_dad) & !missing(Relation_mom) & !missing(birth_weight)

      Comment


      • #18
        Thank you! This is exactly what I was looking for. I will now try to run multiple regression and explain the results.
        Thank you for helping me.

        With kind regards,
        Jord

        Comment


        • #19
          One last question though (hardly dear to ask), is it possible to divide the different education levels of the parents in, lets say, 3 categories ? So, numbers 1 till 6 will be group 1, 7-13 will be group 2 and 13-21 will be group 3. so that the data only shows the numbers 1,2 or 3 for parental education (low educ-, middle educ- and high educ level). It will then be easier to regress on birth weight.
          Thank you in advance,

          Kind regards,
          Jord

          Comment


          • #20
            Code:
            help recode

            Comment


            • #21
              thank you!

              Comment


              • #22
                Dear Schechter,

                After running several regressions, I think I need to add more independent variables to the regression to check its effect on the dependent variable "birth weight". In your answer from 13 April, 13:49, you showed me how to keep the parents' education level and income variables (at the end of the dataset). My question now is if it is possible to also keep the age of the parents? Because now I can only see the age of the child. I want to add this variable to the regression as well if it is possible. Further, how can I add more variables that contain information about the parents to the merged dataset that I have now?

                Thank you in advance!

                With kind regards,
                Jord

                Comment

                Working...
                X