Built using Zelig version 5.1.2.9000


zelig() accept matched datasets from the MatchIt package as the data argument.

First, using the MatchIt package, we attaching the lalonde example dataset, and run matching:

library("MatchIt")
data(lalonde)
m.out <- matchit(treat ~ educ + black + hispan, data = lalonde,
                 method = "optimal")

Then we can use the output object from the MatchIt package directly in the data argument for Zelig:

z.out <- zelig(educ ~ treat, model = "ls", data = m.out)
## How to cite this model in Zelig:
##   R Core Team. 2007.
##   ls: Least Squares Regression for Continuous Dependent Variables
##   in Christine Choirat, Christopher Gandrud, James Honaker, Kosuke Imai, Gary King, and Olivia Lau,
##   "Zelig: Everyone's Statistical Software," http://zeligproject.org/

Zelig will automatically extract the dataset and the weights from the MatchIt object and use them in analysis. For more details on how weights are used in Zelig across models, see the weights section.

From the MatchIt object, it knows what matching method was used, and adds appropriate citations to the reference list accordingly, in addition to the other references it builds from models and utilities in Zelig:

print(z.out$references())
## Ho DE, Imai K, King G and Stuart EA (2011). "MatchIt:
## Nonparametric Preprocessing for Parametric Causal Inference."
## *Journal of Statistical Software*, **42** (8), pp. 1-28. <URL:
## http://www.jstatsoft.org/v42/i08/>.
## 
## Hansen BB and Klopfer SO (2006). "Optimal full matching and
## related designs via network flows." *Journal of Computational and
## Graphical Statistics*, **15** (3), pp. 609-627.
## 
## R Core Team (2017). *R: A Language and Environment for Statistical
## Computing*. R Foundation for Statistical Computing, Vienna,
## Austria. <URL: https://www.R-project.org/>.
## NULL