Support #2310
openWhy cannot merge indall datasets with hhresp datasets on 2000-3000 obs?
50%
Description
Hi team,
Thanks very much for your help!
I have cleaned hhresp datasets and indall datasets and tried to merge them on hipd variable. My codes see below
global wave a b c d e f g h i j k l m n o
foreach var of global wave {
use "$input_data/`var'_treatment.dta",clear
//This is a dataset cleaned based on indall , I kept key variabels I need and did not drop or add any obs.
merge m:1 hidp using "$input_data/`var'_income and poverty.dta"
// This is cleaned based on hhresp . I did not delete or add any obs.
drop _merge
}
Then, Stata returned that around 2000-3000 ind obs (in ind-level datasets) cannot be matched with any household obs in the hh-level datasets. It happened for each wave, except for wave 1.
I am wondering did I merge them wrongly or would you mind providing any inputs on why this happen?
Appreciate all your wonderful help!
Best,
Bing