Announcement

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

  • couple id, family panel data

    Dear stata users,
    In my data I have children, mother and father. There is one record for the child, and the parents have one record for each child. I will compute a couple-id variable. How can I do this.
    The data look like this, in this example below there are 3 children and their parents:
    Many thanks

    children_id mother_id Father_id year
    1001 1 10 2003
    1002 2 20 2003
    1003 3 30 2003
    1001 1 10 2004
    1002 2 20 2004
    1003 3 30 2004
    1001 1 10 2005
    1002 2 20 2005
    1003 3 30 2005

  • #2
    Code:
    egen parent_id= group(mother_id Father_id), label
    assuming mother_id and father_id are distinct across households. If not, you will have to include a household id when defining the groups.

    Comment


    • #3
      Many thanks Andrew.

      Comment

      Working...
      X