Hello,
I am trying to merge the labor force information from Apr-Jun into the March supplement dataset for observations who are not in their ORG month in March supplement.
For example, Observations with MIS=3 or 7 in March will be in their ORG month in April. However, after writing the program (and using h_id, h_hhnum a_lineno, h_mis, a_sex and a_age to make observations in both mster and using file uniqely identified), I see no matching between two data sets (i.e., _merge=1 or _merge=2).
I want to know what is the problem?
In advance, I appreciate you for your help.
Rasoul
Following shows a general structure of my code.
…
*STEP 1: Load data for April for h_mis=4 or 8
use e:\data\cpsapr94, clear
do e:\data\Lfvars
keep if (h_mis==4| h_mis==8)
assert h_mis==4 | h_mis==8
sort h_idnum h_hhnum h_mis a_lineno a_age a_sex h_size
destring h_id, replace
egen count=count(1), by(h_idnum h_mis h_hhnum a_lineno a_age a_sex h_size)
tab count
drop if count > 1
saveold e:\data\apr94B,replace
… * STEP 2: Load data for March for Mis = 3 or 7
use e:\data\cpsmar94, clear
do e:\data\Lfvars
keep if (h_mis==3|h_mis==7)
replace h_mis=h_mis+1 if (h_mis==3 |h_mis==7)
assert h_mis==4 | h_mis==8
sort h_idnum h_hhnum a_lineno h_mis a_age a_sex h_size
destring h_id, replace
egen count=count(1), by(h_idnum h_hhnum h_mis a_lineno a_age a_sex h_size )
tab count
drop if count > 1
…
* STEP 3: Merge April-ORG labor force data to March
merge 1:1 h_idnum h_hhnum a_lineno a_age a_sex h_size using e:\data\apr94B, update
…
Thsi is my result:
Result # of obs.
not matched 73,779
from master 35,011 (_merge==1)
from using 38,768 (_merge==2)
matched 0
not updated 0 (_merge==3)
missing updated 0 (_merge==4)
nonmissing conflict 0 (_merge==5)