Dear all,

I am currently writing my master thesis and struggling a bit with Stata. The aim of my thesis is to examine the potential price effects of US hospital mergers. I have a sample of 439 target hospitals and 1660 controls in the form of panel data. I would like to estimate a model in which I match these target hospitals to a subset of the full control sample that is more similar along observable dimensions. More specifically, I want to perform 1-to-1 optimal Mahalanobis matching, where the distance between hospitals is defined using the 8 continuous variables I employ. These variables are the number of hospital beds (Beds), case-mix index (Tacmiv), wage index (Wageindex), percentage of discharges accounted for by Medicare (Medicare_Discharges_pct) and percentage of discharges accounted for by Medicaid (Medicaid_Discharges_pct). In addition, I want to require that the target and control hospitals are located in the same census division (divisiondum_*) and have the same delineation of geographical area (urban/rural), indicated by a dummy 'Metro'. I already tried to use psmatch2, but without much success. Especially the part regarding the requirement that targets and controls need to be in the same census division and geographical area, is a hard one for me. Could anyone help me out with this? Below you can find a small extract of my dataset for the variables outlined (only one dummy for the census division included) above.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str6 PRVDR_NUM float(year Metro) double(Beds Tacmiv Wageindex) float(Medicare_Discharges_pct Medicaid_Discharges_pct)  byte divisiondum_NE
"010001" 1999 1 400             1.4654             .7909  .4735959 .13554487          0
"010001" 2000 1 353             1.4591             .7836  .4724451 .15957446          0
"010001" 2001 1 353             1.4282             .8013  .4485804 .15731375          0
"010001" 2002 1 353             1.4434             .7988  .4901162  .1468236           0
"010001" 2003 1 345             1.4347             .8158  .4885756  .1254898           0
"010001" 2004 1 345             1.4367             .7765  .52085483 .18387364        0
"010001" 2005 1 345            1.46808            .7651  .50624627 .15858616        0
"010001" 2006 1 370            1.46569            .7757  .50608695  .1895652         0
"010001" 2007 1 370            1.48154            .7663  .51145303  .1627826         0
"010001" 2008 1 370            1.47499            .7567  .492365     .1894842         0
"010001" 2009 1 370            1.49473            .8401  .44918665  .2330852        0
"010001" 2010 1 420            1.59540            .8387  .43276855  .2128815        0
"010001" 2011 1 420            1.67313            .8357  .42509025 .12533845       0
"010001" 2012 1 420            1.66687            .7277  .4351018   .225466           0
"010001" 2013 1 420            1.73792            .7997  .4429717  .1681332          0
"010001" 2014 1 410            1.72364            .8106  .4576775  .1572286          0
"010001" 2015 1 400            1.75065            .7704  .4504436  .1541333          0
"010001" 2016 1 387            1.6826              .6938  .4344438  .1586695          0
"010004" 1999 0 147            .984                  .7338  .3982442 .14046289         0
"010004" 2000 0 139            .9898                .739    .4630873 .14876957         0
end


Any help would be greatly appreciated!

Thank you in advance!