Hi,
I am cleaning panel data. I merged the family data and newborn data, but only the mothers' data are linked, e.g. for family 11, only the mother (ID: 1, Sex: female) has the newborn birth year data. So, could you tell me how to copy the newborn's data to his/her father? Also, I want to assign the newborn_year to all his/her mother's and fathers' records.
ID. Year family_id Sex newborn_year
1. 2001. 11. F. .
1. 2002 11. F. 1994
1. 2003. 11. F. .
2. 2001. 11. M. .
2. 2002. 11. M. .
2. 2003. 11. M. .
3. 2001. 12. F. .
3. 2002 12. F. .
3. 2003. 12. F. 2003
4. 2001. 12. M. .
4. 2002. 12. M. .
4. 2003. 12. M. .
The final data I expect is:
ID. Year family_id Sex newborn_year
1. 2001. 11. F. 1994
1. 2002 11. F. 1994
1. 2003. 11. F. 1994
2. 2001. 11. M. 1994
2. 2002. 11. M. 1994
2. 2003. 11. M. 1994
3. 2001. 12. F. 2003
3. 2002 12. F. 2003
3. 2003. 12. F. 2003
4. 2001. 12. M. 2003
4. 2002. 12. M. 2003
4. 2003. 12. M. 2003
Thank you so much.
Zichun
I am cleaning panel data. I merged the family data and newborn data, but only the mothers' data are linked, e.g. for family 11, only the mother (ID: 1, Sex: female) has the newborn birth year data. So, could you tell me how to copy the newborn's data to his/her father? Also, I want to assign the newborn_year to all his/her mother's and fathers' records.
ID. Year family_id Sex newborn_year
1. 2001. 11. F. .
1. 2002 11. F. 1994
1. 2003. 11. F. .
2. 2001. 11. M. .
2. 2002. 11. M. .
2. 2003. 11. M. .
3. 2001. 12. F. .
3. 2002 12. F. .
3. 2003. 12. F. 2003
4. 2001. 12. M. .
4. 2002. 12. M. .
4. 2003. 12. M. .
The final data I expect is:
ID. Year family_id Sex newborn_year
1. 2001. 11. F. 1994
1. 2002 11. F. 1994
1. 2003. 11. F. 1994
2. 2001. 11. M. 1994
2. 2002. 11. M. 1994
2. 2003. 11. M. 1994
3. 2001. 12. F. 2003
3. 2002 12. F. 2003
3. 2003. 12. F. 2003
4. 2001. 12. M. 2003
4. 2002. 12. M. 2003
4. 2003. 12. M. 2003
Thank you so much.
Zichun

Comment