Hello,
The ID_PERSON that I have is the respondent in the survey and ID_mil ID_fil is the identifier for their spouse's mother and father.
Here the dummies for difficulty_walk, difficulty_toilet, difficulty_dressing and mobility_difficult are given for the respondent ( ie it shows whether the respondent has any difficulty in those activities)
I would like to create separate dummies for the respondent's fil and mil that shows that a respondent's fil /mil had difficulty in walking and going to the toilet etc in the same row.
How can I do that?
I use STATA 14 MP.
The ID_PERSON that I have is the respondent in the survey and ID_mil ID_fil is the identifier for their spouse's mother and father.
Here the dummies for difficulty_walk, difficulty_toilet, difficulty_dressing and mobility_difficult are given for the respondent ( ie it shows whether the respondent has any difficulty in those activities)
I would like to create separate dummies for the respondent's fil and mil that shows that a respondent's fil /mil had difficulty in walking and going to the toilet etc in the same row.
How can I do that?
I use STATA 14 MP.
Code:
------------------ copy up to and including the previous line ------------------Code:* Example generated by -dataex-. To install: ssc install dataex clear input double(ID_PERSON ID_fil ID_mil) float(difficulty_walk difficulty_toilet difficulty_dressing mobility_difficult) 10201001002 102010010 102010010 0 0 0 0 10201002009 10201002001 10201002002 0 0 0 0 10201003002 102010030 102010030 0 0 0 0 10201004002 102010040 102010040 0 0 0 0 10201007002 102010070 102010070 0 0 0 0 10201012002 102010120 102010120 0 0 0 0 10201013002 102010130 102010130 0 0 0 0 10201014002 102010140 102010140 0 0 0 0 10201016004 10201016001 10201016002 0 0 0 0 10201018005 10201018001 10201018002 0 0 0 0 10201019002 102010190 102010190 0 0 0 0 10202001002 102020010 102020010 0 0 0 0 10202002002 102020020 102020020 0 0 0 0 10202003002 102020030 102020030 0 0 0 0 10202004002 102020040 102020040 0 0 0 0 10202006004 10202006001 10202006002 0 0 0 0 10202007004 10202007001 10202007002 0 0 0 0 10202070104 10202070101 10202070102 1 0 0 1 10202011002 102020110 102020110 0 0 0 0 10202014002 10202014075 10202014006 0 0 0 0 10202015002 10202015006 10202015007 0 0 0 0 10202016002 102020160 102020160 0 0 0 0 10202017002 10202017075 10202017007 0 0 0 0 10202018002 102020180 102020180 0 0 0 0 10202019002 102020190 102020190 0 0 0 0 10203002002 102030020 102030020 0 0 0 0 10203005002 102030050 102030050 0 0 0 0 10203006009 10203006001 10203006002 0 0 0 0 10203007002 102030070 102030070 0 0 0 0 10203011002 10203011075 10203011006 0 0 0 0 10203012002 102030120 102030120 0 0 0 0 10203013003 102030130 102030130 0 0 0 0 10203014004 10203014001 10203014002 0 0 0 0 10203015003 102030150 10203015006 0 0 0 0 10203016002 102030160 102030160 0 0 0 0 10203017002 102030170 102030170 0 0 0 0 10203019004 10203019001 10203019002 0 0 0 0 10204001002 10204001075 10204001008 0 0 0 0 10204004002 102040040 102040040 0 0 0 0 10204006002 102040060 102040060 0 0 0 0 10204007002 102040070 102040070 0 0 0 0 10204008004 10204008001 10204008002 0 0 0 0 10204009002 102040090 102040090 0 0 0 0 10204090102 10204090175 10204090175 0 0 0 0 10204012002 102040120 102040120 0 0 0 0 10204013017 102040130 102040130 0 0 0 0 10204017011 10204017001 10204017002 0 0 0 0 10205002002 102050020 102050020 0 0 0 0 10205007004 10205007001 10205007002 0 0 0 0 10205009002 102050090 102050090 0 0 0 0 10205011002 102050110 102050110 0 0 0 0 10205012003 10205012001 10205012075 0 0 0 0 10205130102 10205130175 10205130169 0 0 0 0 10205013002 102050130 102050130 0 0 0 0 10205150102 10205150108 10205150175 0 0 0 0 10205015002 10205015008 10205015075 0 0 0 0 10205016002 102050160 102050160 0 0 0 0 10205017002 102050170 102050170 0 0 0 0 10205018002 102050180 102050180 0 0 0 0 10205019002 102050190 102050190 0 0 0 0 10206001002 102060010 102060010 0 0 0 0 10206002002 102060020 102060020 0 0 0 0 10206003002 10206003075 10206003010 0 0 0 0 10206004002 102060040 102060040 0 0 0 0 10206006002 10206006075 10206006010 0 0 0 0 10206007002 102060070 102060070 0 0 0 0 10206008002 102060080 102060080 0 0 0 0 10206009002 102060090 102060090 0 0 0 0 10206011002 102060110 102060110 0 0 0 0 10206012004 10206012001 10206012002 0 0 0 0 10206014002 102060140 102060140 0 0 0 0 10206015004 10206015001 10206015002 0 0 0 0 10207001002 10207001075 10207001005 0 0 0 0 10207002002 10207002075 10207002014 0 0 0 0 10207003002 102070030 102070030 0 0 0 0 10207004002 102070040 102070040 0 0 0 0 10207005002 10207005028 10207005075 0 0 0 0 10207006004 10207006001 10207006002 0 0 0 0 10207007002 102070070 102070070 0 0 0 0 10207011002 102070110 102070110 0 0 0 0 10207015002 102070150 102070150 1 0 0 1 10208030103 10208030101 10208030175 0 0 0 0 10208005002 102080050 102080050 0 0 0 0 10208006002 102080060 102080060 0 0 0 0 10208007002 102080070 102080070 0 0 0 0 10208009002 102080090 102080090 1 0 0 1 10208010002 102080100 102080100 0 0 0 0 10208011002 102080110 102080110 0 0 0 0 10208120102 10208120175 10208120108 0 0 0 0 10208012002 10208012075 10208012008 0 0 0 0 10208130102 10208130175 10208130175 0 0 0 0 10208013002 102080130 102080130 0 0 0 0 10208014002 102080140 102080140 0 0 0 0 10301020102 10301020175 10301020175 0 0 0 0 10301004002 103010040 103010040 0 0 0 0 10301007002 103010070 103010070 0 0 0 0 10301090104 10301090101 10301090102 0 0 0 0 10301013004 10301013075 10301013006 0 0 0 0 10301015002 103010150 103010150 0 0 0 0 10302001004 10302001075 10302001005 0 0 0 0 end

Comment