From e00e45d4ca9ce15d73dd94f41940feda4c73a2f8 Mon Sep 17 00:00:00 2001 From: tomBSUC <83870919+tomBSUC@users.noreply.github.com> Date: Tue, 7 Jun 2022 13:09:48 -0500 Subject: [PATCH] Update matching-ipw.html line 333 needs a plus sign between the two fractions, instead of a minus sign. --- content/example/matching-ipw.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/example/matching-ipw.html b/content/example/matching-ipw.html index 206aed6..d383ad9 100644 --- a/content/example/matching-ipw.html +++ b/content/example/matching-ipw.html @@ -330,7 +330,7 @@

Step 1: Generate propensity scores

The propensity scores are in the propensity column. Some people, like person 3, are unlikely to use nets (only a 15.8% chance) given their levels of income, temperature, and health. Others like person 6 have a higher probability (42.9%) since their income and health are higher. Neat.

Next we need to convert those propensity scores into inverse probability weights, which makes weird observations more important (i.e. people who had a high probability of using a net but didn’t, and vice versa). To do this, we follow this equation:

\[ -\frac{\text{Treatment}}{\text{Propensity}} - \frac{1 - \text{Treatment}}{1 - \text{Propensity}} +\frac{\text{Treatment}}{\text{Propensity}} + \frac{1 - \text{Treatment}}{1 - \text{Propensity}} \]

This equation will create weights that provide the average treatment effect (ATE), but there are other versions that let you find the average treatment effect on the treated (ATT), average treatment effect on the controls (ATC), and a bunch of others. You can find those equations here.

We’ll use mutate() to create a column for the inverse probability weight: