The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » Mismatch in the partner's age given in the IR file vs MR file (Mismatch in the partner's age given in the IR file (v730) and the age in the MR file (mv012))
Mismatch in the partner's age given in the IR file vs MR file [message #29621] Thu, 11 July 2024 06:07 Go to previous message
Navya is currently offline  Navya
Messages: 8
Registered: May 2022
Member
Hi,

I want to add a few husband/partner characteristics from the MR file to the IR file for the survey waves 2005-06, 2015-16, and 2019-21. For this, I first created a men's file with the indicators I needed, then I duplicated observations based on the number of unique wives' line numbers given for each respondent in the men's files, after which I created a single indicator for the wife's line number (replacing mv034_x with a single mv034 variable), renamed the variables and did a 1:1 merge. I removed all the line numbers for which the wife was not in the household (since the household number could not be matched). Here is the code I used to create the men's dataset for 2019-21:

** identification - husband
rename mv000 v000
rename mv001 v001
rename mv002 v002
rename mv003 v034

** only keep partners who are currently married
keep if mv501 == 1

sort v001 v002 v034

** missing if wife is not in household (cannot match household code with individual file if wife is from a different household)
forvalues i = 1(1)8 {
	replace mv034_`i' = . if mv034_`i' == 0
}

** identification - wife

** drop if all wife line numbers are missing (cannot match with no line number)
drop if mv034_1 == . & mv034_2 == . & mv034_3 == . & mv034_4 == . & mv034_5 == . & mv034_6 == . & mv034_7 == . & mv034_8 == .

save temp.dta, replace

** append datasets based on line numbers to create woman-level dataset
forvalues i = 1(1)8 {
	use temp, clear
	rename mv034_`i' v003
	drop mv034_*
	order v003, after(v002)
	drop if v003 == .
	save temp`i'.dta, replace
}

** append datasets
use temp1, clear

append using temp2
append using temp3
append using temp4
append using temp5
append using temp6
append using temp7
append using temp8

sort v000 v001 v002 v003 v034

save hus_2020.dta, replace

I then used the following code to merge with the IR file:

use "2020/IAIR7EDT/IAIR7EFL.dta", clear

** merge with husband data
merge 1:1 v001 v002 v003 v034 using hus_2020 
drop if _merge == 2

Since the number of observations for each male respondent matched the number of wives listed, the 1:1 merge using the MR file (with the IR file as the master data) on the cluster number ((m)v001 in both files) household number ((m)v002 in both files), respondent's line number (v003 in the IR file, and renamed from mv034_x to v003 in the MR file), and line number of husband (v034 in the IR file, and renamed from mv003 to v034 in the MR file) worked. However, I was trying to match the partner's age given in the IR file (v730) with the merged age variable from the MR file (mv012) to check if the merge was correct, and I was not able to do so. The age for around 22.7% of the partners in the MR file that were successfully matched with the IR file (for which _merge == 3) did not match with the partner's age given in the IR file. I am also getting a mismatch in husband's employment data, since husband/partner's occupation (v705 in IR file) is showing that all husbands in the IR file are working, but the merged indicator from the MR file (mv717) shows that 2.84% of the husbands are not working. I was wondering if I'm doing something wrong here.

Thank you!

[Updated on: Thu, 11 July 2024 06:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to make variable of family type in spss
Next Topic: Guidance on Using Weights for North-East India Analysis in NFHS-5
Goto Forum:
  


Current Time: Tue Oct 8 15:30:31 Coordinated Universal Time 2024