The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use (other programs) » NFHS-5 Disability and health seeking
Re: NFHS-5 Disability and health seeking [message #25608 is a reply to message #25551] Wed, 16 November 2022 11:02 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member
Following is a response from Senior DHS staff member, Tom Pullum:


Here is a Stata program to produce NFHS-5 table 2.29, on disabilities. Construction of this table is tricky because of how the disability variables in the HR file were moved into the PR file. Note that I code the outcomes 0 and 100, rather than 0 and 1, so that the means will be percentages. The tabstat command is helpful. It has a "format" option which can change the number of decimal places. I use fweight because tabstat does not allow iweight. You can get the frequencies with tab and iweight=hv005/1000000.

* Construction of NFHS-5 Table 2.29

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\IAPR7DFL.DTA", clear

* Up to four people in the household may have a disability 
* The line numbers of person a, b, c, d are given by sh33a, sh33b, sh33c, sh33d
* All the variables are repeated for all members of the household

gen dis_any=0
local letters a b c d e x
foreach ll of local letters {
gen dis_`ll'=0
replace dis_`ll'=sh33a1`ll' if hvidx==sh33a
replace dis_`ll'=sh33b1`ll' if hvidx==sh33b
replace dis_`ll'=sh33c1`ll' if hvidx==sh33c
replace dis_`ll'=sh33d1`ll' if hvidx==sh33d
replace dis_`ll'=100*dis_`ll'
replace dis_any =100 if dis_`ll'==100
}

label variable dis_any "Any"
label variable dis_a "Hearing"
label variable dis_b "Speech"
label variable dis_c "Visual"
label variable dis_d "Mental"
label variable dis_e "Locomotor"
label variable dis_x "Other"

gen age=0
replace age=1 if hv105>=5
replace age=2 if hv105>=15
replace age=3 if hv105>=25
replace age=4 if hv105>=35
replace age=5 if hv105>=50
replace age=6 if hv105>=70
replace age=7 if hv105>95

label define age 0 "0-4" 1 "5-14" 2 "15-24" 3 "25-34" 4 "35-49" 5 "50-69" 6 "70+" 7 "DK/missing" 
label values age age

tabstat dis_* if hv102==1 [fweight=hv005], statistics(mean) by(hv025)
tabstat dis_* if hv102==1 [fweight=hv005], statistics(mean) by(age)

* Repeat for hv104=1, 2, 3
forvalues lsex=1/3 {
tabstat dis_* if hv102==1 & hv104==`lsex' [fweight=hv005], statistics(mean) by(hv025)
tabstat dis_* if hv102==1 & hv104==`lsex' [fweight=hv005], statistics(mean) by(age)
} 

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merging PR and KR file NFHS
Next Topic: Reproducing reports in R using Github Code
Goto Forum:
  


Current Time: Tue Nov 26 20:34:27 Coordinated Universal Time 2024