The PSMATCH Procedure

Example 95.5 Matching with Replacement

(View the complete code for this example.)

This example performs matching with replacement in the propensity score analysis. The data set School contains the student information and is described in Example 95.4.

The following statements invoke the PSMATCH procedure and request matching with replacement to match observations for students in the treatment group with observations for students in the control group:

ods graphics on;
proc psmatch data=School region=allobs(psmin=0.05);
   class Music Gender;
   psmodel Music(Treated='Yes')= Gender Absence;
   match method=replace(k=1) stat=ps exact=Gender caliper=.;
   assess ps var=(Gender Absence);
   output out(obs=match)=outex5 matchid=_MatchID;
run;

The CLASS statement specifies the classification variables. The PSMODEL statement specifies the logistic regression model that creates the propensity score for each student, which is the probability that the student enrolled in the music class. The Music variable is the binary treatment indicator variable, and TREATED='Yes' identifies Yes as the treated group. The Gender and Absence variables are included in the model because they are believed to be related to enrolling in the music class.

The REGION= option specifies an interval region of propensity scores such that only observations that have propensity scores in the region are used in stratification and matching. Because the MATCH statement is also specified, the REGION=ALLOBS(PSMIN=0.05) option requests that all available observations whose propensity scores are greater than or equal to 0.05 be used for matching.

The MATCH statement requests matching and specifies the criteria for matching. The STAT=PS option requests that the propensity score be used in computing differences between pairs of observations. The METHOD=REPLACE(K=1) option requests matching with replacement in which each treated unit is matched to the closest control unit.

The EXACT=GENDER option forces the treated unit and its matched control unit to have the same value of the Gender variable. The CALIPER=. option ignores the caliper requirement for matching.

The "Data Information" table in Output 95.5.1 displays information about the input and output data sets, the numbers of observations in the treated and control groups, the lower and upper limits for the propensity score support region, and the numbers of observations in the treated and control groups that fall within the support region. Of the 140 observations in the control group, 134 fall within the support region.

Output 95.5.1: Data Information

The PSMATCH Procedure

Data Information
Data SetWORK.SCHOOL
Output Data SetWORK.OUTEX5
Treatment VariableMusic
Treatment GroupYes
All Obs (Treatment)60
All Obs (Control)140
Support RegionPS Bounded Obs
Lower PS Support0.05
Upper PS Support0.490191
Support Region Obs (Treatment)60
Support Region Obs (Control)134


The "Propensity Score Information" table in Output 95.5.2 displays summary statistics by treatment group for all observations, for support region observations, and for matched observations.

Output 95.5.2: Propensity Score Information

Propensity Score Information
ObservationsTreated (Music = Yes)Control (Music = No)
NMeanStd DevMinimumMaximumNMeanStd DevMinimumMaximum
All600.3471430.0961840.0928310.4901911400.2797960.1249970.0264650.488875
Region600.3471430.0961840.0928310.4901911340.2906110.1165210.0517460.488875
Matched600.3471430.0961840.0928310.490191410.3351460.1034870.0929630.488875


Note that the number of matched control units (41) is less than the number of matched treated units (60) because for matching with replacement, a control unit can be matched with more than one treated unit.

The "Matching Information" table in Output 95.5.3 displays the matching criteria, the number of matched sets, the numbers of matched observations in the treated and control groups, and the total absolute difference in the propensity score for all matches. For matching with replacement, one control unit might be matched to more than one treated unit. In this example, 41 control units are matched to 60 treated units.

Output 95.5.3: Matching Information

Matching Information
Difference StatisticPropensity Score
MethodReplacement Matching
Control/Treated Ratio1
Matched Sets41
Matched Obs (Treated)60
Matched Obs (Control)41
Total Absolute Difference0.264451


The ASSESS statement produces tables and plots that summarize differences in the specified variables between treated and control groups for all observations, for the support region observations, and for the matched observations. You can use these results to assess how well the matching achieves a balance in the distributions of these variables. As requested by the PS and VAR= options, the variables are the propensity score and the covariates Gender and Absence.

The "Standardized Variable Differences" table displays standardized differences between the treated and control groups for all observations, the support region observations, and the matched observations, as shown in Output 95.5.4.

Output 95.5.4: Standardized Differences

The PSMATCH Procedure

Standardized Variable Differences (Treated - Control)
Variable Standardized Mean Difference 
Mean DifferenceDivisorMean DifferencePercent ReductionVariance Ratio
All ObsRegion ObsMatched ObsWeighted Matched
Obs
All ObsRegion ObsMatched ObsWeighted Matched
Obs
Region ObsMatched ObsWeighted Matched
Obs
All ObsRegion ObsMatched ObsWeighted Matched
Obs
PS0.0673470.0565320.0119970.0011760.1115250.6038760.5069000.1075740.01054616.0682.1998.250.59210.68140.86381.0062
Absence-0.697568-0.531749-0.087541-0.0085411.136945-0.613546-0.467700-0.076997-0.00751323.7787.4598.780.35500.50500.81921.0029
Gender-0.045238-0.033831-0.05203300.496344-0.091143-0.068160-0.104831025.220.00100.001.02081.01381.02541.0000


When ODS Graphics is enabled, the PSMATCH procedure displays a standardized variable differences plot for the variables that are specified in the ASSESS statement, as shown in Output 95.5.5.

Output 95.5.5: Standardized Differences Plot

Standardized Differences Plot


The "Standardized Variable Differences Plot" displays the standardized differences in the "Variable Differences" table in Output 95.5.4. All differences for the matched observations are within the recommended limits of –0.25 and 0.25, which are indicated by reference lines.

If you are not satisfied with the variable balance, you can do one or more of the following until you are satisfied: you can select another set of variables to fit the propensity score model, you can modify the matching criteria, or you can choose another matching method.

The OUT(OBS=MATCH)=OutEx5 option in the OUTPUT statement creates an output data set, OutEx5, that contains the matched observations. The following statements list the 10 observations in OutEx5 that have the largest propensity scores, as shown in Output 95.5.6.

proc sort data=OutEx5 out=OutEx5a;
   by descending _PS_;
run;

proc print data=OutEx5a(obs=10);
   var StudentID Music Gender Absence _PS_ _MATCHWGT_ _MatchID;
run;

Output 95.5.6: Output Data Set of Matched Observations with Replacement

ObsStudentIDMusicGenderAbsence_PS__MATCHWGT__MatchID
1156YesMale0.017920.49019141
2142YesMale0.024510.48926141
3105NoMale0.027230.48888241
464NoMale0.033170.48804140
598YesMale0.054430.48503140
630NoMale0.100430.47853239
7182YesMale0.103520.47810139
8115YesMale0.110020.47718139
9130NoMale0.176510.46780138
10104YesMale0.189860.46592138


By default, the output data set includes the variable _PS_ (which provides the propensity score) and the variable _MATCHWGT_ (which provides matched observation weights). The MATCHID=_MatchID option creates a variable named _MatchID that identifies the matched sets of observations.

If you assume that no other confounding variables are associated with both the GPA and the music class indicator Music, you can add the GPAs for the students to the data set OutEx5 and perform an outcome analysis of GPA on this data set to estimate the music class effect.