Add basic code to compute propensity scores

The code is unoptimized so that it's easiest to understand.