Skip to content

Commit 11fc9e7

Browse files
committed
CR51 code - Disability profiles
1 parent c431453 commit 11fc9e7

File tree

2 files changed

+213
-0
lines changed

2 files changed

+213
-0
lines changed

CR51_disability/Disability.do

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
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+
}

CR51_disability/Readme.MD

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Readme CR51: Disability Profiles
2+
3+
The disability.do file can be used to construct the disability indicators used in [DHS Comparative Report #51: Profile and Correlates of Persons Living with Disability](https://www.dhsprogram.com/publications/publication-cr51-comparative-reports.cfm?csSearch=1027381_1).
4+
The file also constructs several background variables available in the PR file and generates identifying variables needed for merging.
5+
6+
The resulting PR coded file for each survey (`cn'PRcoded.dta where cn is the country code) can be merged with the IR or MR file to further describe disability status by women or men's characteristics that are not found in the PR file (for example religion, ethnicity, or experience of domestic violence). The domestic violence indicators can be found in [the DHS Program Code Share Library - Stata repository](https://github.com/DHSProgram/DHS-Indicators-Stata) in chapter 17.
7+
8+
The example code below shows how to merge the resulting PR coded file after running the disability.do file with the corresponding IR file for the survey.
9+
10+
```stata
11+
* path to DHS data, change to your own
12+
global Datafilepath "C:\DHSdata"
13+
14+
* IR files for the surveys used in the analysis. These surveys must be downloaded and saved in your Datafilepath
15+
global irdata "HTIR71FL MLIR7AFL NGIR7BFL PKIR71FL RWIR81FL ZAIR71FL SNIR8BFL TLIR71FL UGIR7BFL"
16+
17+
foreach c in $irdata {
18+
use "$Datafilepath/`c'.dta", clear
19+
20+
*to get the country code (ex: HT, ML, etc.)
21+
local cn=substr("`c'",1,2)
22+
23+
*perform the merge.
24+
merge 1:1 v001 v002 v003 using "$Codedfilepath\\`cn'PRcoded.dta"
25+
keep if _merge==3
26+
27+
save "$Codedfilepath//`cn'PRIRcoded.dta", replace
28+
29+
}
30+
31+
32+
```

0 commit comments

Comments
 (0)