Support #2148
open
link children's birth year and month with parents
Added by Eve Liu 4 months ago.
Updated 3 months ago.
Category:
Data documentation
Description
Dear staff from Understanding Society,
I am currently doing a research which requires to link the parents and children's birthday. I mainly use the two data file "xwavedat_protect", "xwaveid_bh_protect" (although I don't know what's the difference between two datasets) and also "xhhrel_protect". Based on previous issues, I tried to follow your "do file" by firstly rename the pidp. My code is like:
using "xwavedat_protect"
gen bcx_pidp_1 = pidp //bcx_pidp_1 means the first biological child
save "xwavedat_protect", replace
using "xhhrel_protect"
merge 1:m bcx_pidp_1 using "xwavedat_protect"
Then it shows errors, variable bcx_pidp_1 does not uniquely identify observations in the master data
I would be really appreciate if you could help me solve this issue.
I think I have figure it out by using "rename pidp bcx_pidp_1" in "xwavedat_protect", and then
using "xhhrel_protect"
merge m:1 bcx_pidp_1 using "xwavedat_protect"
Is there any easier way to gen bcx_pidp_'i' in one "xwavedat_protect"? otherwise, I may need to repeat rename and save.
- Category set to Data documentation
- Status changed from New to Feedback
- % Done changed from 0 to 50
- Private changed from Yes to No
Hello Eve,
I recommend reviewing section "4.2: Using xhhrel to match sample member information with specific relatives" on page 7 of the Understanding Society: Linking Family Members and Households Over Time Using the Family Matrix (xhhrel) User Guide. This section includes an example syntax for attaching information from specific family members using main survey data alongside family identifiers from the family matrix.
I hope this information is helpful.
Best wishes,
Roberto Cavazos
Understanding Society User Support Team
- % Done changed from 50 to 80
Also available in: Atom
PDF