- Dear Statalist,
I am currently working with a dataset that contains information on all household members. My objective is to pair each child with their corresponding mother. The dataset includes the following key variables:- hhid: Household ID
- pidlink: Personal ID for each individual
- pid14: Order of household members
- ar11: Order of the mother among all household members (from pid14)
Could anyone suggest the most efficient way to achieve this pairing in Stata?
Thank you for your time and assistance.
Best regards,
Sania Abbasi
Code:* Example generated by -dataex-. To install: ssc install dataex clear input str8 hhid str10 pidlink double(pid14 ar11) "0010600" "001060001" 1 52 "0010600" "001060004" 4 2 "0010600" "001060007" 7 52 "0010600" "001060008" 8 7 "0010600" "001060009" 9 7 "0010600" "001060010" 10 7 "0010600" "001060011" 11 7 "0010651" "001060004" 1 52 "0010651" "001065102" 2 51 "0010651" "001065103" 3 1 "0010651" "001065104" 4 1 "0010800" "001080001" 1 52 "0010800" "001080003" 3 2 "0010800" "001080004" 4 2 "0010800" "001080005" 5 2 "0010800" "001080006" 6 2 "0010800" "001080007" 7 2 "0010800" "001080008" 8 2 "0010800" "001080009" 9 2 "0010800" "001080010" 10 2 "0010800" "001080012" 12 51 "0010851" "001080003" 1 52 "0010851" "001080012" 2 52 "0010851" "001085103" 3 2 "0010851" "001085104" 4 2 "0010851" "001085105" 5 2 "0010851" "001085106" 6 2 "0010851" "001085107" 7 2 "0012200" "001220001" 1 52 "0012200" "001220002" 2 51 "0012200" "001220003" 3 2 "0012200" "001220004" 4 2 "0012200" "001220005" 5 2 "0012200" "001220006" 6 2 "0012200" "001220007" 7 2 "0012200" "001220008" 8 2 "0012200" "001220009" 9 2 "0012200" "001220010" 10 2 "0012200" "001220011" 11 51 "0012200" "001220013" 13 11 "0012200" "001220014" 14 2 "0012200" "001220015" 15 2 "0012241" "001220003" 1 51 "0012241" "001220011" 2 51 "0012241" "001220013" 3 2 "0012241" "001224104" 4 2 "0012241" "001224105" 5 2 "0012241" "001224106" 6 2 "0012242" "001220008" 1 51 "0012251" "001220009" 1 51 end label values ar11 ar11 label def ar11 51 "51:Did not live in this household", modify label def ar11 52 "52:Dead", modify
-
Login or Register
- Log in with
Comment