The PSMATCH Procedure

Example 95.2 Propensity Score Stratification

(View the complete code for this example.)

This example creates strata of observations that are based on propensity scores for patients in the trial in 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 five strata that are based on propensity scores:

ods graphics on;
proc psmatch data=drugs region=allobs;
   class Drug Gender;
   psmodel Drug(Treated='Drug_X')= Gender Age Bmi;
   strata nstrata=5;
   assess ps var=(Gender Age Bmi)
          / varinfo plots=(boxplot barchart);
   output out(obs=all)=OutEx2;
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 such that only observations that have propensity scores in the region are used in stratification and matching. You can also 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 STRATA statement creates strata of observations based on propensity scores. The NSTRATA=5 option (which is the default) stratifies observations in the support region into five strata.

The "Data Information" table in Output 95.2.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. Note that because REGION=ALLOBS, all 373 observations in the control group fall within the support region.

Output 95.2.1: Data Information

The PSMATCH Procedure

Data Information
Data SetWORK.DRUGS
Output Data SetWORK.OUTEX2
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
Number of Strata5


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

Output 95.2.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


When you specify a STRATA statement, the "Strata Information" table in Output 95.2.3 displays the minimum and maximum propensity scores, the total number of treated observations, and the total number of controls in each stratum.

Output 95.2.3: Strata Information

Strata Information
Stratum
Index
 Frequencies
Propensity Score RangeTreatedControlTotal
10.0201570.19435822209231
20.1967420.261300235982
30.2618610.322300233861
40.3259370.434208234164
50.4379270.685757222648


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 PS and VAR= options, the variables listed in the table are the propensity score and the variables Gender, Age, and Bmi. When you specify a STRATA statement, WEIGHT=NONE by default, suppressing display of differences for the weighted observations.

The VARINFO option displays the "Variable Information" table, which contains variable differences between the treated and control groups for all observations and for the support region observations, as shown in Output 95.2.4. For a binary classification variable (Gender), the difference is in the proportion of the first ordered level (Female).

Output 95.2.4: Variable Information

The PSMATCH Procedure

Variable Information
VariableObservationsTreated (Drug = Drug_X)Control (Drug = Drug_A)
NMeanStd DevMinimumMaximumNMeanStd DevMinimumMaximum
PSAll1130.3107730.1324670.0602310.6411483730.2088010.1319690.0201570.685757
 Region1130.3107730.1324670.0602310.6411483730.2088010.1319690.0201570.685757
AgeAll11336.3097355.53411426.00000049.00000037340.4048266.57910325.00000057.000000
 Region11336.3097355.53411426.00000049.00000037340.4048266.57910325.00000057.000000
BmiAll11324.4925661.86379720.33000028.34000037323.7532711.98077819.22000028.610000
 Region11324.4925661.86379720.33000028.34000037323.7532711.98077819.22000028.610000
GenderAll1130.4336280.495575  3730.4584450.498270  
 Region1130.4336280.495575  3730.4584450.498270  


When REGION=ALLOBS, the statistics are identical between all observations and the support region observations.

The "Standardized Variable Differences" table in Output 95.2.5 displays the standardized differences between the treated and control groups for all observations and for the support region observations,

Output 95.2.5: Standardized Differences

Standardized Variable Differences (Treated - Control)
Variable Standardized Mean Difference 
Mean DifferenceDivisorMean DifferencePercent ReductionVariance Ratio
All ObsRegion ObsAll ObsRegion ObsRegion ObsAll ObsRegion Obs
PS0.1019720.1019720.1322180.7712420.7712420.001.00761.0076
Age-4.095091-4.0950916.079104-0.673634-0.6736340.000.70760.7076
Bmi0.7392960.7392961.9231780.3844140.3844140.000.88540.8854
Gender-0.024817-0.0248170.496925-0.049941-0.0499410.000.98920.9892


When ODS Graphics is enabled, the PLOTS option displays plots for the specified variables. The plots without strata information are not shown here because the REGION=ALLOBS option results in all observations being in the support region.

When you specify a STRATA statement, the ASSESS statement also produces tables and plots that summarize differences in the specified variables between treated and control groups by stratum.

The VARINFO option in the ASSESS statement displays the variable information of the treated and control groups for observations in each stratum, as shown in Output 95.2.6.

Output 95.2.6: Strata Variable Information

The PSMATCH Procedure

Strata Variable Information
Region Observations
VariableStratum
Index
Treated (Drug = Drug_X)Control (Drug = Drug_A)
NMeanStd DevMinimumMaximumNMeanStd DevMinimumMaximum
PS1220.1404010.0413600.0602310.1943582090.1158910.0438590.0201570.194132
 2230.2219930.0194180.1967420.259357590.2282110.0183950.1973420.261300
 3230.2998610.0188110.2634970.322300380.2945680.0175410.2618610.321559
 4230.3808690.0260770.3266800.434184410.3705520.0306460.3259370.434208
 5220.5120860.0582000.4379270.641148260.5311820.0718930.4412040.685757
Age12242.9090914.15083635.00000049.00000020944.4497614.81170632.00000057.000000
 22337.6521743.93825929.00000044.0000005938.2542374.30554329.00000047.000000
 32336.5652173.87094229.00000043.0000003835.4210533.63638927.00000043.000000
 42333.6956524.24729626.00000041.0000004134.2195123.08635929.00000041.000000
 52230.7727272.82727927.00000035.0000002629.8076922.93964925.00000037.000000
Bmi12223.5009091.75120320.33000026.11000020923.1754071.91723719.24000027.850000
 22323.6530431.79440120.43000026.6600005923.8784751.95106219.22000027.680000
 32324.7078261.76444420.85000027.5600003824.1081581.69832520.24000027.600000
 42324.9152171.95017720.98000028.3400004124.9358541.48491622.37000028.290000
 52225.6950001.13033823.32000028.0600002625.7307691.33795323.41000028.610000
Gender1220.4545450.497930  2090.5071770.499948  
 2230.5652170.495728  590.3220340.467256  
 3230.3913040.488042  380.4473680.497222  
 4230.4347830.495728  410.3902440.487805  
 5220.3181820.465770  260.5000000.500000  


The "Strata Standardized Variable Differences" table in Output 95.2.7 displays the variable differences, standardized differences, reduction percentages, and ratios of variances for observations in each stratum. The standardized difference is the variable difference divided by the divisor (which is displayed in the "Standardized Variable Differences" table in Output 95.2.5), and the reduction percentage compares the standardized difference with the standardized difference of all observations.

Output 95.2.7: Strata Standardized Differences

Strata Standardized Variable Differences (Treated - Control)
Region Observations
VariableStratum
Index
Mean
Difference
Standardized
Difference
Percent
Reduction
Variance
Ratio
PS10.0245090.18537075.960.889269
 2-0.006219-0.04703393.901.114307
 30.0052930.04003594.811.149989
 40.0103170.07803089.880.724072
 5-0.019096-0.14443081.270.655343
Age1-1.540670-0.25343762.380.744171
 2-0.602063-0.09903885.300.836667
 31.1441650.18821372.061.133163
 4-0.523860-0.08617487.211.893792
 50.9650350.15874676.430.925010
Bmi10.3255020.16925255.970.834299
 2-0.225431-0.11721869.510.845857
 30.5996680.31181118.891.079380
 4-0.020636-0.01073097.211.724822
 5-0.035769-0.01859995.160.713731
Gender1-0.052632-0.1059150.000.991940
 20.2431830.4893770.001.125585
 3-0.056064-0.1128220.000.963416
 40.0445390.0896290.001.032750
 5-0.181818-0.3658870.000.867769


When ODS Graphics is enabled, the strata standardized differences for the specified variables are displayed, as shown in Output 95.2.8.

Output 95.2.8: Strata Standardized Differences Plot

Strata Standardized Differences Plot


The "Strata Standardized Variable Differences Plot" displays the standardized differences in the "Strata Standardized Variable Differences" table in Output 95.2.7. The plot shows larger differences in Stratum 2 and Stratum 5 for Gender.

The PLOTS=BOXPLOT option displays a strata variable box plot for each continuous variable, as shown in Output 95.2.9 for PS, Output 95.2.10 for Age, and Output 95.2.11 for Bmi. The box plots show reasonably good variable balance in each stratum.

Output 95.2.9: PS Strata Box Plot

PS Strata Box Plot


Output 95.2.10: Age Strata Box Plot

Age Strata Box Plot


Output 95.2.11: Bmi Strata Box Plot

Bmi Strata Box Plot


PLOTS=BARCHART displays a strata variable bar chart for each classification variable, as shown in Output 95.2.12 for Gender. The bar chart shows differences in the female and male relative frequencies between the treated and control groups in Stratum 2 and Stratum 5.

Output 95.2.12: Gender Strata Bar Chart

Gender Strata Bar Chart


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 (for instance, by using nonlinear terms for the continuous variables or by adding interactions), you can increase the number of strata, or you can choose another propensity score method (such as matching).

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

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

Output 95.2.13: Output Data Set with Strata

ObsPatientIDDrugGenderAgeBmi_PS__STRATA_
1284Drug_XMale2922.020.364444
2201Drug_AMale4526.680.222962
3147Drug_AMale4221.840.113231
4307Drug_XMale3822.710.197332
5433Drug_AMale3122.760.353114
6435Drug_AMale4326.860.272633
7159Drug_AFemale4525.470.149111
8368Drug_AFemale4924.280.077801
9286Drug_AMale3123.310.383414
10163Drug_XFemale3925.340.249952


By default, the output data set includes the variable _PS_ (which provides the propensity score) and the variable _STRATA_ (which provides stratum indices).

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 OutEx2, you can estimate the treatment effect within each stratum and combine these estimates across strata to estimate the treatment effect (Stuart 2010, pp. 13–14).