03-04-2015 06:03 PM
I've been using a nearest neighbor without replacement propensity score matching macro and have some questions about it. Some background information: I'm working with a large control data set and a smaller treatment data set. Both data sets are subsetted by year. Both the comparison and the treatment data sets have already had propensity scores calculated. The issue is that the the number of treatment records inputted into the macro doesn't equal the number of treatment records outputted from the macro. For example with 2010 treatment: there are a total of 11,482 unique treatment records inputted but only 11,286 treatment records are matched to the 2010 unique control records. Can anyone tell me why I'm losing records?
The second question revolves around a portion of the macro itself. The macro I used for my PSMs is found at http://home.uchicago.edu/~mcoca/docs/PSmatching.sas. I'm particularly interested in this part:
/* Open the treatment */
%if %upcase(&method) ~= RADIUS %then %do;
retain BestDistance 99;
/* Iterate over the hash */
if (rc=0) then BestDistance=99;
do while (rc=0);
/* Caliper */
%if %upcase(&method) = CALIPER %then %do;
if (pscoreT - %caliper) <=pscoreC <= (pscoreT + &caliper) then do;
if ScoreDistance < BestDistance then do;
if (rc~=0) then do;
What is the purpose of BestDistance? Is that identifying the closest and best matching control record? And if I remove the BestDistance=99 portion, will that help me match the lost treatment records if I rerun the PSM?
If not, is there an easy way to alter the macro to insure that all inputted treatment records are matched to control records?
03-04-2015 10:22 PM
The 99 is intended to be a "really big number" so that any actual distance will be less than that.
Which of the various METHOD settings did you use? For example if you use METHOD=CALIPER then the distance must be within +/- the &CALIPER value.
03-05-2015 09:51 AM
I didn't set a caliper value in the macro statement:
%macro PSMatching(datatreatment=2010_treatment, datacontrol=2010_control, method=NN, numberofcontrols=2, caliper=, replacement=no, out=beaconated_matched);
Based on your input, I'm starting to think that distance wasn't a factor in the dropped treatment records. Maybe the macro couldn't find matches for the 2010 treatment records from the 2010 comparison group?
03-05-2015 10:25 AM
Did you check that your cases do not have missing values for the propensity score?
Did you try with replacement? Does that yield a control for every case?