Fork me on GitHub


Propensity Score Matching for Non-Binary Treatments


a. Propensity scores are estimated for three models:

$${ PS }{ 1 }=e({ x }{ { T }_{ 1 }C })=Pr(z=1 { x }{ { T }{ 1 }C })$$
$${ PS }{ 2 }=e({ x }{ { T }_{ 2 }C })=Pr(z=1 { x }{ { T }{ 2 }C })$$
$${ PS }{ 3 }=e({ x }{ { T }{ 2 }{ T }{ 1 } })=Pr(z=1 { x }{ { T }{ 2 }{ T }_{ 1 } })$$

b. Match order is determined. The default behavior is to start with the larger of the two treatments, followed the second treatment, and lastly the control group. However, the match order is configurable vis-à-vis the match.order parameter.

c. Three distance matrices are calculated, ${D}{1}$, ${D}{2}$, and ${D}_{3}$ corresponding to the propensity scores estimated in step a.

d. Distances greater than the caliper (.25 by default, see Rosenbaum & Rubin, 1985) are eliminated. The caliper is specified in standard units so .25 corresponds to one-quarter of one standard deviation. Therefore the threshold for each model in actual units will be different.

e. The first element from group one is selected and the nmatch smallest elements from group two with a distance less than the caliper are selected. Note that the default value for nmatch is Inf so that all elements within the caliper are considered. For large datasets this can have a substantial impact on execution time. Although setting nmatch to a smaller value will increase execution time during development, we recommend setting nmatch to Inf for final results.

f. For each element in group two selected in step e, the nmatch smallest elements from group three with a distance less thant he caliper are selected.

g. The distance between each element identified in step f and the starting element from group one is retrieved and those with distance less than the caliper are retained. All matched triplets are saved to a data frame.

h. Steps e to g are repeated for the remaining elements in group one.

i. The total distance for each matched triplet identified in steps e to h are calculated and the data frame is sorted on the total distance.

j. The M unique smallest matched triplets are returned.


The latest development version of TriMatch can be installed from Github using the devtools package.

install_github("TriMatch", "jbryer")


The following examples are included in the TriMatch package as demos. Type demo(package='TriMatch') to get started.


Imai, K., & van Dyk, D.A. (2004). Causal Inference With General Treatment Regimes: Generalizing the Propensity Score. Journal of the American Statistical Association, 99(467).

National Medical Expenditure Survey

National Center for Health Services Research and Health Care Technology Assessment. NATIONAL MEDICAL EXPENDITURE SURVEY, 1987: INSTITUTIONAL POPULATION COMPONENT. Rockville, MD: Westat, Inc. [producer], 1987. Ann Arbor, MI: Inter-university Consortium for Political and Social Research [distributor], 1990. doi:10.3886/ICPSR09280.v1

Rosenbaum, P.R., & Rubin, D.B. (1983). The Central Role of the Propensity Score in Observational Studies for Causal Effects. Biometrika, 70(1).

Rosenbaum, P.R., & Rubin, D.B. (1885) Constructing a control group using multivariate matched sampling methods that incorporate teh propensity score. The American Statistician, 39(1).

Rubin, D.B., & Stuart, E.A. (). Matching with Multiple Control Groups, and Adjusting for Group Differences.

Spreeuwenberg, M.D., Bartak A., Croon, M.A., Hagenaars, J.A., Busschbach, J.J.V.,Andrea, H., Twisk, J., & Stijnen, T. (2010). The Multiple Propensity Score as Control for Bias in the Comparison of More Than Two Treatment Arms. Medical Care, 48(2).

Zhao, S., van Dyk, D.A., & Imai, K. (2012). Causal Inference in Observational Studies with Non-Binary Treatments.

= Github page; = RSS XML Feed; = External website; = Portable Document File (PDF)
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Creative Commons License
Formulas powered by MathJax