Loading ...

How to Calculate Propensity Scores

Updated March 23, 2017

Propensity scores are usually used to help compare two or more groups of subjects (most often people) in an observational study where there may be selection bias. When we have data on more than a few variables about each person, it can be simpler to summarise that information into a single score and then use that score to match people. Alternatively, we can use the score itself as a covariate.

Loading ...
  1. Collect the data and enter it properly into a computer program, such as SAS, R, SPSS or Stata. Data are usually obtained from ongoing studies. They can be entered into a spreadsheet and then read into a statistics program, or they can be entered directly into the statistics program using built-in functions. Many statistics packages offer other ways to import data as well.

  2. Use the software's logistic regression function with the dependent variable being the probability of being selected and the independent variables being all the covariates. The proper way to perform logistic regression varies with the program. For example, in SAS, PROC LOGISTIC is appropriate; in R, the glm() function is appropriate. Each statistics package has extensive documentation. According to authorities such as Rosenthal and Rosnow, it is better to include more variables as opposed to fewer.

  3. Output the conditional probability of being selected, given the covariates. For example, in SAS, you would use a statement similar to that used by Parsons:

  4. OUTPUT OUT= STUDY.Propen prob=prob

  5. Here, the data set "STUDY" would have a variable called "prob". This is the propensity score.

  6. Check that the model balances the covariates. That is, check that the logistic regression gives a relatively complete explanation. In SAS, you can use the "lackfit" option on the model statement, which implements the Hosmer-Lemeshow test of goodness of fit. A large p-value indicates good fit, but you can look at the tabular output as well.

  7. Tip

    Do not use the usual variable selection methods when calculating propensity scores. Do not rely on p-values or statistical significance to include or exclude variables. Do not worry about overfitting the model. Do not be too concerned with model diagnostics.


    Do not expect propensity scores to solve all problems of matching. In particular, there must be substantial overlap in propensity scores between the subjects in the different groups.

Loading ...

Things You'll Need

  • Computer
  • Outcome data
  • Grouping data
  • Covariate data

About the Author

Peter Flom is a statistician and a learning-disabled adult. He has been writing for many years and has been published in many academic journals in fields such as psychology, drug addiction, epidemiology and others. He holds a Ph.D. in psychometrics from Fordham University.

Loading ...