I am trying to run a Nearest Neighbor Matching in order to run a DID inference on it.

Background:

Stata 13

This dataset contains panel data from Compustat merged with Thomson Reuters M&A dataset.


What I need to do:

Due to the nature of this data set, I have to match firms according to their size (ln(Assets) + Industry code (SIC).

In order to match the firms by Asset and SIC, I will use Nearest Neighbor Matching (nnmatch).

I have to match year and SIC code as exact (ematch)

(Later on) After matching is done, I need to perform a DID estimation to see if there is a causal effect.


However, when I use the teffects nnmatch code using ematch, I get an error.

Code:
gen treatment = 0
replace treatment = 1 if merger==1
teffects nnmatch (income industry_sic assets firm_year) (treatment), biasadj(assets) ematch(firm_year industry_sic) vce(robust) dmvariables


Error: "12 observations have no exact matches"


It runs fine if I don't use ematch but I need it in order to compare apples to apples. What do I do to deal with this problem?


Dataset:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int(id firm_year) byte industry_sic int(assets income merger_year) byte merger
111 2000 22  10  10    . .
111 2001 22  12  20 2002 1
111 2002 22  30 400    . .
111 2003 22  50 470    . .
111 2004 22  60 490    . .
333 2000 22  15  10 2001 1
333 2001 22  40 100 2002 1
333 2002 22  70 200    . .
333 2003 22  80 260    . .
333 2004 22  85 270 2007 1
333 2005 22  90 280    . .
333 2006 22  95 290    . .
333 2007 22 120 700    . .
555 2000 37  40  10 2001 1
555 2001 37  60  50    . .
555 2002 37  70  70    . .
end