Hello everyone,

I am trying to perform a nearest-neighbor matching in Stata by using the teffects command. I want to perform an exact match on a geographic variable called District, and then a weighted average match on two continuous variables like population and meanage. My idea is to first match municipalities according to the same district, and then, inside the same district, to match treated units with the closest control ones in terms of population and age of the population.

The code I am using is the following

Code:
teffects nnmatch (y population meanage) (treat), atet nn(3) ematch(District)
The code returns me this error

14 observations have no exact matches.
The error disappears when I do not exactly match by the District variable. The inclusion of the continuous variables do not create any issue instead. I really do not understand how it's possible not to have enough control observations to match with the treatment ones at the district level. I indeed have approximately 3-5 treatment units and 50-60 control ones in each district, and I am simply asking to match treatment units with control ones in the same district without any other variable entering the exact match process.

Does anybody know how to help me?

Many thanks in advance,
Marco