3 weeks ago
I am trying to do a 1 to 1 match. I did it the following way. The results were 2721 matches which I am confused about since my control observations are over 400,000 and trying to get one match for each of my 7,000 observations in my sample. Can anyone help me figure it out. Ultimately there should be 7,000 matches so there is a total of 14,000 individual observations.
my data has gvkey (company identifier), fyear (fiscal year), sic (industry), TA (total assets)
create table want as
select s.*, c.gvkey as match_firm, c.AT as match_assets, c.fyear as match_year
from sample1 as s inner join control1 as c
where c.gvkey ne s.gvkey
group by s.gvkey
having abs(s.AT-c.AT) = min(abs(s.AT-c.AT));
select * from want;
3 weeks ago
I expect 7000 matches so 14,000 total observations ---- 7000 from my sample and 7000 from the control. Regardless, it doesnt make sense to have less than half.
3 weeks ago - last edited 3 weeks ago
Possible causes that I can think of
Many sic have a single gvkey in the control dataset
Many AT values are missing in the sample dataset
Some sic in the sample do not occur in the control dataset
if none of those apply, I'm as puzzled as you are.