Function for processing matching with propensity score

1 |

`z` |
vector of indicators for treatment or control. |

`score` |
vector of the propensity scores in the same order as z. |

`replace` |
whether the control units could be reused for matching,
default is |

Function for matching each treatment unit in turn the control unit (not previously chosen) with the closest propensity score

The function returns a vector of indices that the corresponding unit is matched to. 0 means matched to nothing.

Jeniffer Hill jh1030@columbia.edu; Yu-Sung Su suyusung@tsinghua.edu.cn

Andrew Gelman and Jennifer Hill. (2006).
*Data Analysis Using Regression and Multilevel/Hierarchical Models*.
Cambridge University Press.

`balance`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
# matching first
data(lalonde)
attach(lalonde)
fit <- glm(treat ~ re74 + re75 + age + factor(educ) +
black + hisp + married + nodegr + u74 + u75,
family=binomial(link="logit"))
pscores <- predict(fit, type="response")
matches <- matching(z=lalonde$treat, score=pscores)
matched <- lalonde[matches$matched,]
# balance check!
b.stats <- balance(lalonde, matched, fit)
print(b.stats)
plot(b.stats)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.