The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » General » Extracting data from HH (Partner/Husband Education from HH file)
Extracting data from HH [message #24631] Fri, 10 June 2022 02:21 Go to previous message
mrriips is currently offline  mrriips
Messages: 2
Registered: August 2019
Location: Mumbai, India
Member
Hi,

I was extracting husband/partner educational attainment from the HH file [IAHR7AFL] to match with women's file [IAIR7AFL] and using below code because women file have missing cases for their partner/husband education.

gen hus_edu = .
forval o = 1/9 {
forval k = 2/9 {
replace hus_edu = hv108_0`o' if hv101_0`k' == 2 & hv104_0`k' == 2
}
}
.

forval o = 10/35 {
forval k = 11/35 {
replace hus_edu = hv108_`o' if hv101_`k' == 2 & hv104_`k' == 2
}
}
.
ta hus_edu

Please suggest.

Thanks in advance
Mukesh Ravi Raushan


 
Read Message
Read Message
Read Message
Previous Topic: BDHS 2014 : Calculating level weights
Next Topic: Multiple Sexual Partner in Husband
Goto Forum:
  


Current Time: Fri Sep 30 11:15:35 Coordinated Universal Time 2022