| Merging IR and AR datasets (Uganda AIS 2011) [message #10894] | 
			Fri, 30 September 2016 14:21   | 
		 
		
			
				
				
				
					
						  
						pearlapb
						 Messages: 1 Registered: September 2016 
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi! I'm working on HIV and education and I'm trying to merge the HIV dataset of UAIS with the IR on STATA: 
 
This is what I've done: 
 
-------------- 
 
use "/Users/pb/Desktop/UGAR6AFL.DTA", clear 
rename hivclust v001 
rename hivnumb v002 
rename hivline v003 
rename hiv03 vhiv03 
rename hiv05 vhiv05 
keep v* 
 
sort v001 v002 v003 
 
save "/Users/pb/Desktop/UAIS_HIV.dta", replace 
 
use "/Users/pb/Desktop/FINAL UAIS Dataset.dta", clear 
sort v001 v002 v003 
merge v001 v002 v003 using "Users/pb/Desktop/UAIS_HIV.dta" 
rename _merge _merge_HIV 
 
------------- 
 
My initial dataset was composed of 21,741 observations, but I end up with a merged dataset of 32,021 observations. I don't understand where the 10,280 extra observations come from.  
I had understood that the UAIS 2011 IR file was for both women and men, as there is no men only dataset (no MR) and the IR file has an aidsex variable showing if the respondent is male or female... (?) 
 
Can anyone explain what I am not understanding and where I am making the mistake? 
 
Thank you! 
 
		
		
		
 |  
	| 
		
	 | 
 
 
 |