An implementation of Díaz, Rau and Rivera (2015) matching estimator for causal inference. The authors propose a matching estimator based on a Bilevel Optimization Problem. In raw terms, the two problems are (1) finding a convex combination that (2) using the closets neighbors possible. The solution to this problem allows computing Treatment Effect estimators that significantly improve balance in case-control studies, and furthermore, can be used for data imputation.
knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
devtools::install_github("gvegayon/blopmatch")
# Loading the package library(blopmatch) # Simulating data set.seed(1331) X <- matrix(rnorm(200*5), ncol=5) # Matching individual 5 to the rest ans <- blopi_glpk(X[5,,drop=FALSE], X[-5,,drop=FALSE]) # Resulting weights (matches) ans$lambda # Target vs Projected X[5,] ans$lambda %*% X[-5,]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.