Extracting data from HH [message #24631] |
Fri, 10 June 2022 02:21 |
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
|
|
|