The PSMATCH Procedure

Example 95.1 Propensity Score Weighting

(View the complete code for this example.)

This example creates observation weights for all patients in the trial of a propensity score analysis. The Drugs data set contains the patient information and is described in the section Getting Started: PSMATCH Procedure.

The following statements invoke the PSMATCH procedure and create observation weights that are appropriate to estimate the average treatment effect for the treated (ATT):

ods graphics on;
proc psmatch data=drugs region=allobs;
   class Drug Gender;
   psmodel Drug(Treated='Drug_X')= Gender Age Bmi;
   assess lps var=(Gender Age Bmi)
          / varinfo plots=(boxplot barchart)
            weight=attwgt;
   output out(obs=all)=OutEx1;
run;

The CLASS statement specifies the classification variables. The PSMODEL statement specifies the logistic regression model that creates the propensity score for each observation, which is the probability that the patient receives Drug_X. The Drug variable is the binary treatment indicator variable, and TREATED='Drug_X' identifies Drug_X as the treated group. The Gender, Age, and Bmi variables are included in the model because they are believed to be related to the assignment.

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. Even without stratification and matching, you can still use the REGION= option to select observations in the region to compare variable differences between observations in the treatment and control groups. The REGION=ALLOBS option selects all available observations.

The "Data Information" table in Output 95.1.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. Because REGION=ALLOBS is specified, all 373 observations in the control group fall within the support region.

Output 95.1.1: Data Information

The PSMATCH Procedure

Data Information
Data SetWORK.DRUGS
Output Data SetWORK.OUTEX1
Treatment VariableDrug
Treatment GroupDrug_X
All Obs (Treatment)113
All Obs (Control)373
Support RegionAll Obs
Lower PS Support0.020157
Upper PS Support0.685757
Support Region Obs (Treatment)113
Support Region Obs (Control)373


The "Propensity Score Information" table in Output 95.1.2 displays summary statistics by treatment group for all observations and for the support region observations. Because REGION=ALLOBS is specified, all observations are in the support region.

Output 95.1.2: Propensity Score Information

Propensity Score Information
ObservationsTreated (Drug = Drug_X)Control (Drug = Drug_A)
NMeanStd DevMinimumMaximumNMeanStd DevMinimumMaximum
All1130.3107730.1324670.0602310.6411483730.2088010.1319690.0201570.685757
Region1130.3107730.1324670.0602310.6411483730.2088010.1319690.0201570.685757


The ASSESS statement produces the tables and plots that summarize differences in the specified variables between treated and control groups for all observations and for the support region 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=ATTWGT option also summarizes differences in the specified VAR= variables between treated and control group of differences for the weighted observations.

The "Variable Information" table in Output 95.1.3 displays variable differences between the treated and control groups for all observations and for the support region observations. With the WEIGHT=ATTWGT option, the differences for the weighted region observations are also displayed. For a binary classification variable (Gender), the difference is in the proportion of the first ordered level (Female).

Output 95.1.3: Variable Information

The PSMATCH Procedure

Variable Information
VariableObservationsTreated (Drug = Drug_X)Control (Drug = Drug_A)
NWeightMeanStd DevMinimumMaximumNWeightMeanStd DevMinimumMaximum
LPSAll113 -0.8806150.681761-2.7474440.580348373 -1.5205860.844486-3.8838580.780357
 Region113 -0.8806150.681761-2.7474440.580348373 -1.5205860.844486-3.8838580.780357
AgeAll113 36.3097355.53411426.00000049.000000373 40.4048266.57910325.00000057.000000
 Region113 36.3097355.53411426.00000049.000000373 40.4048266.57910325.00000057.000000
 ATT Weighted Region113113.0036.3097355.53411426.00000049.000000373116.5935.8774426.22666725.00000057.000000
BmiAll113 24.4925661.86379720.33000028.340000373 23.7532711.98077819.22000028.610000
 Region113 24.4925661.86379720.33000028.340000373 23.7532711.98077819.22000028.610000
 ATT Weighted Region113113.0024.4925661.86379720.33000028.340000373116.5924.6000421.94881819.22000028.610000
GenderAll113 0.4336280.495575  373 0.4584450.498270  
 Region113 0.4336280.495575  373 0.4584450.498270  
 ATT Weighted Region113113.000.4336280.495575  373116.590.4431060.496753  


With REGION=ALLOBS, the statistics are identical between all observations and the support region observations. In addition, the statistics are also identical to weighted support region observations in the treated group, because each treated unit receives a weight of 1 when WEIGHT=ATTWGT. The total weight of the control units is 116.59, which is close to 113, the total weight of treated units. Also, the weighted variable means for support region control units are closer to the corresponding variable means for support region treated units. The statistics for the logit of propensity score are not displayed because the ATT weights for observations are computed from their propensity scores.

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

Output 95.1.4: Standardized Differences

Standardized Variable Differences (Treated - Control)
Variable Standardized Mean Difference 
Mean DifferenceDivisorMean DifferencePercent ReductionVariance Ratio
All ObsRegion ObsATT Weighted Region
Obs
All ObsRegion ObsATT Weighted Region
Obs
Region ObsATT Weighted
Region Obs
All ObsRegion ObsATT Weighted
Region Obs
LPS0.6399710.639971 0.7674480.8338940.833894 0.00 0.65170.6517 
Age-4.095091-4.0950910.4322936.079104-0.673634-0.6736340.0711110.0089.440.70760.70760.7899
Bmi0.7392960.739296-0.1074761.9231780.3844140.384414-0.0558840.0085.460.88540.88540.9147
Gender-0.024817-0.024817-0.0094780.496925-0.049941-0.049941-0.0190730.0061.810.98920.98920.9953


The standardized mean differences are significantly reduced in the weighted region observations; the largest of these differences is 0.0711 in absolute value, which is less than the recommended upper limit of 0.25 (Rubin 2001, p. 174; Stuart 2010, p. 11). The variance ratios between the two groups are within the recommended range of 0.5 to 2. With REGION=ALLOBS, the percentage of reduction in variable mean difference is 0 for the support region 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.1.5.

Output 95.1.5: Standardized Differences Plot

Standardized Differences Plot


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

The PLOTS=BOXPLOT option requests a box plot for the logit of propensity score (LPS) and for each continuous variable specified in the ASSESS statement, as shown in Output 95.1.6, Output 95.1.7, and Output 95.1.8. The box plots show good variable balance for the weighted support region observations.

Output 95.1.6: LPS Box Plot

LPS Box Plot


Output 95.1.7: Age Box Plot

Age Box Plot


Output 95.1.8: Bmi Box Plot

Bmi Box Plot


The PLOTS=BARCHART option displays a bar chart for each classification variable that is specified in the ASSESS statement, as shown in Output 95.1.9. The bar chart displays similar distributions of Gender between males and females for the weighted support region observations.

Output 95.1.9: Gender Bar Chart

Gender Bar Chart


Because there is good balance in the weighted distributions of the variables Gender, Age, and Bmi, you can output all observations (including added observation weights) so that they can be used for subsequent weighted outcome analysis.

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 specification of the propensity score model by using nonlinear terms for the continuous variables or by adding interactions (Rosenbaum and Rubin 1984), or you can choose another propensity score method (such as matching).

The OUT(OBS=ALL)=OutEx1 option in the OUTPUT statement creates an output data set, OutEx1, that contains all available observations. The following statements list the first 10 observations in OutEx1, as shown in Output 95.1.10.

proc print data=OutEx1(obs=10);
   var PatientID Drug Gender Age Bmi _ps_ _AttWgt_;
run;

Output 95.1.10: Output Data Set with PS Weights

ObsPatientIDDrugGenderAgeBmi_PS__ATTWGT_
1284Drug_XMale2922.020.364441.00000
2201Drug_AMale4526.680.222960.28694
3147Drug_AMale4221.840.113230.12768
4307Drug_XMale3822.710.197331.00000
5433Drug_AMale3122.760.353110.54586
6435Drug_AMale4326.860.272630.37482
7159Drug_AFemale4525.470.149110.17523
8368Drug_AFemale4924.280.077800.08437
9286Drug_AMale3123.310.383410.62182
10163Drug_XFemale3925.340.249951.00000


By default, the output data set includes the variable _PS_ (which provides the propensity score) and the variable _ATTWGT_ (which provides matched observation weights). The weight for each treated unit is 1, and the weight for each control unit is computed as p / (1 – p), where p is the propensity score.

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 OutEx1, you can use the same outcome analysis with weights on this output data set as you would have used on the original data set Drugs (augmented with responses) to estimate the treatment effect.