Announcement

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

  • Help adding a dummy variable

    I am working with longitudinal household data and am (very) stuck at creating a dummy variable that takes the value 1 if a woman is having a child in the following year (so first baby next year is the variable I want to create). Here is a description of the data, where HID is the household ID, PID is the personal ID, and mother ID is the PID of the mother of the person. Any help would be greatly appreciated.

    year HID PID Sex Age MotherID First baby next year
    2019 115 1151 F 30 . 1
    2020 115 1151 F 31 . 0
    2021 115 1151 F 32 . 0
    2020 115 1152 M 1 1151 .
    2021 115 1152 M 2 1151 .
    2021 115 1153 F 1 1151 .

  • #2
    Welcome to Statalist.

    You have accidentally posted your topic in Statalist's Mata Forum, which is used for discussions of Stata's Mata language, which is different than Stata's command language, and different than Stata's matrix commands. Your question will see a more appropriate and much larger audience if you post it in Statalist's General Forum.

    Also, if you have not already done so, take a look at the Statalist FAQ linked to at the top of this page for posting guidelines and suggestions.

    Comment


    • #3
      Thank you, I posted my question in the general forum, and would like to delete the post, but am not sure how.

      Comment


      • #4
        Deleting is not possible, so don’t worry about it. It’s not a problem.

        Comment

        Working...
        X