The PSMATCH Procedure

Example 95.7 Matching with Existing Propensity Scores in the Input Data Set

(View the complete code for this example.)

This example performs optimal matching with propensity scores already available in the input data set. The Drugs data set contains the patient information and is described in the section Getting Started: PSMATCH Procedure.

The following statements use the LOGISTIC procedure to fit a binary complementary log-log model and to derive propensity scores:

ods select none;
proc logistic data=drugs;
   class Drug Gender;
   model Drug(Event='Drug_X')= Gender Age Bmi / link=cloglog;
   output out=drug1 p=pscore;
run;
ods select all;

The output data set Drug1 is constructed from the data set Drugs and contains the PScore variable for propensity scores.

Output 95.7.1 lists the first 10 observations.

Output 95.7.1: Output Drug Data Set with Propensity Scores

First 10 Observations of the Input Drug Data Set

ObsPatientIDDrugGenderAgeBmipscore
1284Drug_XMale2922.020.35498
2201Drug_AMale4526.680.21794
3147Drug_AMale4221.840.12261
4307Drug_XMale3822.710.19821
5433Drug_AMale3122.760.34298
6435Drug_AMale4326.860.26261
7159Drug_AFemale4525.470.15077
8368Drug_AFemale4924.280.08713
9286Drug_AMale3123.310.37211
10163Drug_XFemale3925.340.24005


The following statements invoke the PSMATCH procedure and request an optimal matching to match patients in the treatment group to patients in the control group:

ods graphics on;
proc psmatch data=Drug1 region=cs;
   class Drug Gender;
   psdata treatvar=Drug(Treated='Drug_X') ps=pscore;
   match method=optimal(k=1) exact=Gender stat=lps caliper=0.5;
   assess lps var=(Gender Age Bmi) / weight=none;
   output out(obs=match)=OutEx7 lps=_Lps matchid=_MatchID;
run;

The CLASS statement specifies the classification variables. The PSDATA statement specifies the binary treatment variable and the variable for propensity score information in the input DATA= data set. The TREATVAR=DRUG option specifies DRUG as the binary treatment indicator variable, and TREATED='Drug_X' identifies Drug_X as the treated group

The REGION= option specifies an interval region of propensity scores (or equivalently, logits 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=CS option requests that only observations that have propensity scores in the common support region be used for matching. By default, the region is extended by 0.25 times the pooled estimate of the common standard deviation of the logit of the propensity score, where this estimate is the square root of the average of the variances in the treated and control groups.

The MATCH statement specifies the criteria for matching. The STAT=LPS option (which is the default) requests that the logit of the propensity score be used in computing differences between pairs of observations. The METHOD=OPTIMAL(K=1) option (which is the default) requests optimal matching of one control unit to each unit in the treated group in order to minimize the total within-pair difference. The EXACT=GENDER option forces the treated unit and its matched control unit to have the same value of the Gender variable. The CALIPER=0.5 option specifies the caliper requirement for matching: for a match to be made, the difference in the logits of the propensity score for pairs of individuals from the two groups must be less than or equal to 0.5 times the pooled estimate of the common standard deviation of the logits of propensity scores.

The "Data Information" table in Output 95.7.2 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 373 observations in the control group, 352 fall within the support region.

Output 95.7.2: Data Information

The PSMATCH Procedure

Data Information
Data SetWORK.DRUG1
Output Data SetWORK.OUTEX7
Treatment VariableDrug
Treatment GroupDrug_X
All Obs (Treatment)113
All Obs (Control)373
Support RegionExtended Common Support
Lower PS Support0.060563
Upper PS Support0.698199
Support Region Obs (Treatment)113
Support Region Obs (Control)352


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

Output 95.7.3: Propensity Score Information

Propensity Score Information
ObservationsTreated (Drug = Drug_X)Control (Drug = Drug_A)
NMeanStd DevMinimumMaximumNMeanStd DevMinimumMaximum
All1130.3040220.1286690.0715210.6594203730.2088640.1255200.0294520.713529
Region1130.3040220.1286690.0715210.6594203520.2145970.1176840.0606270.651891
Matched1130.3040220.1286690.0715210.6594201130.2984440.1215410.0723440.651891


The "Matching Information" table in Output 95.7.4 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 logit of the propensity score for all matches.

Output 95.7.4: Matching Information

Matching Information
Difference StatisticLogit of Propensity Score
MethodOptimal Fixed Ratio Matching
Control/Treated Ratio1
Caliper (Logit PS)0.356051
Matched Sets113
Matched Obs (Treated)113
Matched Obs (Control)113
Total Absolute Difference3.616259


The ASSESS statement produces the 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. As requested by the LPS and VAR= options, the variables listed in the table are the logit of propensity score and the variables Gender, Age, and Bmi. The WEIGHT=NONE option suppresses display of differences for the weighted matched observations. Note that for a matching of one control unit to each treated unit, the weights are all 1 for matched treated and control units, and the results are identical for the weighted matched observations and the matched observations.

The "Standardized Variable Differences" table displays standardized differences between the treated and control groups for all observations, for the support region observations, and for the matched observations, as shown in Output 95.7.5. For a binary classification variable (Gender), the difference is in the proportion of the first ordered level (Female).

Output 95.7.5: Standardized Differences

The PSMATCH Procedure

Standardized Variable Differences (Treated - Control)
Variable Standardized Mean Difference 
Mean DifferenceDivisorMean DifferencePercent ReductionVariance Ratio
All ObsRegion ObsMatched ObsAll ObsRegion ObsMatched ObsRegion ObsMatched ObsAll ObsRegion ObsMatched Obs
LPS0.5823910.5161300.0226770.7121020.8178480.7247970.03184511.3896.110.71770.90521.0929
Age-4.095091-3.5851520.1150446.079104-0.673634-0.5897500.01892512.4597.190.70760.79281.0143
Bmi0.7392960.6508900.1461951.9231780.3844140.3384450.07601711.9680.230.88540.93941.3509
Gender-0.024817-0.01807600.496925-0.049941-0.036376027.16100.000.98920.99161.0000


The standardized mean differences are significantly reduced in the matched observations, and the largest of these differences is 0.076 in absolute value, which is less than the recommended upper limit of 0.25. The variance ratios between the two groups are between 1 and 1.1967 for all variables in the matched observations, which is within the recommended range of 0.5 to 2. Because both EXACT=GENDER and METHOD=OPTIMAL are specified in the MATCH statement, the standardized difference for Gender is 0 in the matched observations.

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.7.6.

Output 95.7.6: Standardized Differences Plot

Standardized Differences Plot


The "Standardized Variable Differences Plot" displays the standardized differences in the "Standardized Variable Differences" table in Output 95.7.5. 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)=OutEx7 option in the OUTPUT statement creates an output data set, OutEx7, that contains the matched observations. The following statements list the 10 observations OutEx7 that have lowest propensity scores, as shown in Output 95.7.7:

proc sort data=OutEx7 out=OutEx7a;
   by pscore;
run;

proc print data=OutEx7a(obs=10);
   var PatientID Drug Gender Age Bmi pscore _LPS _MatchWgt_ _MatchID;
run;

Output 95.7.7: Output Data Set With Optimal Matches

ObsPatientIDDrugGenderAgeBmipscore_Lps_MATCHWGT__MatchID
189Drug_XFemale4420.750.07152-2.5635611
2213Drug_AFemale4923.240.07234-2.5512311
3323Drug_XFemale4622.220.07822-2.4667712
4245Drug_AFemale5225.320.08090-2.4301512
5217Drug_XMale4923.960.09796-2.2201313
6429Drug_AMale4924.000.09865-2.2122813
7234Drug_XFemale4121.110.09887-2.2098714
866Drug_AFemale4824.530.09927-2.2053114
9183Drug_AFemale4523.620.10931-2.0978615
10320Drug_XFemale4624.170.11056-2.0850715


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 weight for each treated unit is 1. Because K=1 is specified in the METHOD= option in the MATCH statement, one control unit is matched to each treated unit; so the weight for each matched control unit is also 1. The LPS=_LPS option creates a variable named _LPS, which provides the logit of propensity score, and the MATCHID=_MatchID option creates a variable named _MatchID, which identifies the matched sets of observations.

If you assume that no other confounding variables are associated with both the response variable and the treatment group indicator Drug, then after the responses for the trial are observed and added to the data set OutEx7, you can use the same outcome analysis on this output data set as you would have used on the original data set Drugs (with added responses) to estimate the treatment effect.