|
| 1 | +/***************************************************************************************************** |
| 2 | +Program: Disability.do |
| 3 | +Purpose: Code disability variables |
| 4 | +Author: Shireen Assaf. |
| 5 | +Date last modified: July 17, 2023 by Shireen Assaf |
| 6 | +*****************************************************************************************************/ |
| 7 | + |
| 8 | +* path to DHS data, change to your own path |
| 9 | +global Datafilepath "C:\DHSdata" |
| 10 | + |
| 11 | +* surveys used in the analysis. These surveys must be downloaded and saved in your Datafilepath |
| 12 | +global prdata "HTPR71FL MLPR7AFL NGPR7BFL PKPR71FL RWPR81FL ZAPR71FL SNPR8BFL TLPR71FL UGPR7BFL" |
| 13 | + |
| 14 | +* Prepare PR files |
| 15 | +foreach c in $prdata { |
| 16 | +use "$Datafilepath/`c'.dta", clear |
| 17 | + |
| 18 | +*drop under 5 - disability questions not asked for children 0-4 |
| 19 | +drop if hv105<5 |
| 20 | + |
| 21 | +************************************** |
| 22 | +*** Disabilitiy measrues *** |
| 23 | +************************************** |
| 24 | + |
| 25 | +* Uganda and Senegal have country-specific disability variable names. Therefore, these are renamed to the standard variable names for all countries. |
| 26 | + |
| 27 | +*Rename Uganda disability vars |
| 28 | + if "`c'"=="UGPR7BFL" { |
| 29 | + rename sh23 hdis1 //glasses |
| 30 | + rename sh24 hdis2 //vision |
| 31 | + replace hdis2=sh25 if hdis2==. |
| 32 | + rename sh26 hdis3 //hearing aid |
| 33 | + rename sh27 hdis4 //hearing |
| 34 | + replace hdis4=sh28 if hdis4==. |
| 35 | + rename sh29 hdis5 //communication |
| 36 | + rename sh30 hdis6 //cognition |
| 37 | + rename sh31 hdis7 //mobility |
| 38 | + rename sh32 hdis8 //self-care |
| 39 | + } |
| 40 | + |
| 41 | +*Rename Senegal disability vars |
| 42 | + if "`c'"=="SNPR8BFL" { |
| 43 | + rename sh20ga hdis1 //glasses |
| 44 | + rename sh20gb hdis2 //vision |
| 45 | + replace hdis2=sh20gc if hdis2==. |
| 46 | + rename sh20gd hdis3 //hearing aid |
| 47 | + rename sh20ge hdis4 //hearing |
| 48 | + replace hdis4=sh20gf if hdis4==. |
| 49 | + rename sh20gg hdis5 //communication |
| 50 | + rename sh20gh hdis6 //cognition |
| 51 | + rename sh20gi hdis7 //mobility |
| 52 | + rename sh20gj hdis8 //self-care |
| 53 | + } |
| 54 | + |
| 55 | +**Disability vars - any difficulty coded as disability |
| 56 | + gen dsight= inrange(hdis2,2,7) |
| 57 | + replace dsight=. if hdis2==. |
| 58 | + lab var dsight "Vision disability - any" |
| 59 | + |
| 60 | + gen dhear= inrange(hdis4,2,7) |
| 61 | + replace dhear=. if hdis4==. |
| 62 | + lab var dhear "Hearing disability - any" |
| 63 | + |
| 64 | + gen dspeech= inrange(hdis5,2,7) |
| 65 | + replace dspeech=. if hdis5==. |
| 66 | + lab var dspeech "Speech/communication disability - any" |
| 67 | + |
| 68 | + gen dcog= inrange(hdis6,2,7) |
| 69 | + replace dcog=. if hdis6==. |
| 70 | + lab var dcog "Cognitive disability - any" |
| 71 | + |
| 72 | + gen dwalk= inrange(hdis7,2,7) |
| 73 | + replace dwalk=. if hdis7==. |
| 74 | + lab var dwalk "Mobility disability - any" |
| 75 | + |
| 76 | + gen dcare=inrange(hdis8,2,7) |
| 77 | + replace dcare=. if hdis8==. |
| 78 | + lab var dcare "Self-care disability - any" |
| 79 | + |
| 80 | + gen disab=0 |
| 81 | + replace disab=1 if dsight==1 | dhear==1 | dspeech==1 | dcog==1 | dwalk==1 | dcare==1 |
| 82 | + replace disab=. if hdis2==. | hdis4==.| hdis5==.| hdis6==. | hdis7==.| hdis8==. |
| 83 | + lab var disab "Any disability" |
| 84 | + |
| 85 | + |
| 86 | + egen totdisany= rsum(dsight dhear dspeech dcog dwalk dcare) |
| 87 | + recode totdisany (0=0 "None") (1=1 "One") (2/6=2 "2+"), gen(disnumany) |
| 88 | + lab var disnumany "Number of disabilities - any" |
| 89 | + |
| 90 | + recode totdisany (2/6=1 "2+") (0/1=0 "0-1"), gen(dis2p) |
| 91 | + |
| 92 | + |
| 93 | +**Disability vars - a lot of difficulty or cannot do at all |
| 94 | + gen dsightsv= inrange(hdis2,3,7) |
| 95 | + replace dsightsv=. if hdis2==. |
| 96 | + lab var dsightsv "Vision disability - severe" |
| 97 | + |
| 98 | + gen dhearsv= inrange(hdis4,3,7) |
| 99 | + replace dhearsv=. if hdis4==. |
| 100 | + lab var dhearsv "Hearing disability - severe" |
| 101 | + |
| 102 | + gen dspeechsv= inrange(hdis5,3,7) |
| 103 | + replace dspeechsv=. if hdis5==. |
| 104 | + lab var dspeechsv "Speech/communication disability - severe" |
| 105 | + |
| 106 | + gen dcogsv= inrange(hdis6,3,7) |
| 107 | + replace dcogsv=. if hdis6==. |
| 108 | + lab var dcogsv "Cognitive disability - severe" |
| 109 | + |
| 110 | + gen dwalksv= inrange(hdis7,3,7) |
| 111 | + replace dwalksv=. if hdis7==. |
| 112 | + lab var dwalksv "Mobility disability - severe" |
| 113 | + |
| 114 | + gen dcaresv=inrange(hdis8,3,7) |
| 115 | + replace dcaresv=. if hdis8==. |
| 116 | + lab var dcaresv "Self-care disability - severe" |
| 117 | + |
| 118 | + gen disabsv=0 |
| 119 | + replace disabsv=1 if dsightsv==1 | dhearsv==1 | dspeechsv==1 | dcogsv==1 | dwalksv==1 | dcaresv==1 |
| 120 | + replace disabsv=. if hdis2==. | hdis4==.| hdis5==.| hdis6==. | hdis7==.| hdis8==. |
| 121 | + lab var disabsv "Any disability - severe" |
| 122 | + |
| 123 | + egen totdissv= rsum(dsightsv dhearsv dspeechsv dcogsv dwalksv dcaresv) |
| 124 | + recode totdissv (0=0 "None") (1=1 "One") (2/6=2 "2+"), gen(disnumsv) |
| 125 | + lab var disnumsv "Number of disabilities - severe" |
| 126 | + |
| 127 | + recode totdissv (2/6=1 "2+") (0/1=0 "0-1"), gen(dis2psv) |
| 128 | + |
| 129 | +************************************** |
| 130 | +*** Background vars *** |
| 131 | +************************************** |
| 132 | + |
| 133 | +* sex hv104 |
| 134 | + |
| 135 | +*age |
| 136 | +recode hv105 (5/14=0 "5-14") (15/24 =1 "15-24") (25/34=2 "25-34") (35/49=3 "35-49") (50/95=4 "50+") (else=.), gen(hhage) |
| 137 | +* age2 |
| 138 | +recode hv105 (5/9=0 "5-9") (10/14 =1 "10-14") (15/19=2 "15-19") (20/29=3 "20-29") (30/39=4 "30-39") (40/49=5 "40-49") (50/59=6 "50-59") (60/95=7 "60+") (else=.), gen(hhage2) |
| 139 | + |
| 140 | +* edu |
| 141 | +recode hv106 (0=1 None) (1=2 Primary) (2/3=3 "Secondary+") (8/9=.), gen(hhedu) |
| 142 | + |
| 143 | +*marital status |
| 144 | +recode hv115 (0=1 "Never married") (1=2 "Currently in a union") (2/4=3 "Formally in a union") (8 9 . =4 "No marital status information or NA"), gen(hhmstatus) |
| 145 | + |
| 146 | +* wealth v190 |
| 147 | +* need to modify the label to change from poorest, etc to the labels below |
| 148 | +cap label define hv270 1"Lowest" 2"Second" 3"Middle" 4"Fourth" 5"Highest", modify |
| 149 | +cap label define HV270 1"Lowest" 2"Second" 3"Middle" 4"Fourth" 5"Highest", modify |
| 150 | + |
| 151 | +* place of residence v025 |
| 152 | +cap label define hv025 1"Urban" 2"Rural", modify |
| 153 | +cap label define HV025 1"Urban" 2"Rural", modify |
| 154 | + |
| 155 | +*number of household members |
| 156 | +recode hv009 (1/2=1 "1-2") (3/4=2 "3-4") (5/8=3 "5-8") (9/max=4 "9+") (98 99 =.), gen(hhnum) |
| 157 | +label var hhnum "Number of household members" |
| 158 | + |
| 159 | +************************************** |
| 160 | + |
| 161 | +* for merging with IR files |
| 162 | +gen v001=hv001 |
| 163 | +gen v002=hv002 |
| 164 | +gen v003=hvidx |
| 165 | + |
| 166 | +* for merging with MR files |
| 167 | +gen mv001=hv001 |
| 168 | +gen mv002=hv002 |
| 169 | +gen mv003=hvidx |
| 170 | + |
| 171 | +*** Strata *** |
| 172 | +* to get strata, this can be found in the Intro_DHSdata_Analysis\2_SurveyDesign folder of the Analysis repository |
| 173 | +qui do "Survey_strata.do" |
| 174 | + |
| 175 | +keep v001-v003 mv001-mv003 hv000-hv025 hv102-hv105 hv270 d* hh* tot* strata |
| 176 | + |
| 177 | +*to get the country code (ex: HT, ML, etc.) |
| 178 | +local cn=substr("`c'",1,2) |
| 179 | + |
| 180 | +save "$Codedfilepath//`cn'PRcoded.dta", replace |
| 181 | +} |
0 commit comments