The argument "weights" takes the name of the variable. So, you should try
something like:
weights = "weights"
Best,
Kosuke
Department of Politics
Princeton University
Dear professor,
Thanks for your answer! I finally built on MatchIt to write quick functions to help in
the matching with multiple imputation (equivalent to matchit, summary and match.data). I
don't think they are very elegant but I send them to you anyway now that they are
done (with a csv file with data as an example).
More importantly, I get an error warning with a syntax adapted from Ho et al. (2011) with
MatchIt to calculate ATT. The syntax with the article is with method=”nearest” with no
replacement. I tried with replacement. Therefore, it seems I need to introduce weights
when estimating the model on the controls. But when I apply the resulting model on the
treated I get a problem with different variables length for the weights. To make sure the
control group is well matched I think I must introduce the weights anyway but I’m unsure
how to do it. Under is my syntax with the lalonde data.
library(MatchIt)
library(Zelig)
data(lalonde)
m.out0 <- matchit(treat ~ age + educ + black + hispan + nodegree + married + re74 +
re75, method = "nearest",replace=T, data = lalonde)
datacontrol= match.data(m.out0, "control")
summary(m.out0)
datatreat=match.data(m.out0, "treat")
z.out1 <- zelig(re78 ~ age + educ + black + hispan + nodegree + married + re74 + re75,
data = datacontrol,weights=datacontrol$weights, model = "ls")
x.out1 <- setx(z.out1, data = datatreat, cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
Best regards,
Jean-Baptiste
--- En date de : Jeu 15.9.11, Kosuke Imai <kimai(a)Princeton.EDU> a écrit :
De: Kosuke Imai <kimai(a)Princeton.EDU>
Objet: Re: MatchIt Zelig and multiple imputation
À: "Pingaul jb" <pingaultjb(a)yahoo.fr>
Cc: "matchit" <matchit(a)lists.gking.harvard.edu>du>,
"zelig(a)lists.gking.harvard.edu" <zelig(a)lists.gking.harvard.edu>
Date: Jeudi 15 septembre 2011, 5h03
Unfortunately, I don't think we have an automated procedure for everything. You
would have to multiply impute the data, do matching on each imputed data set, and then
combine it in zelig() using mi() function. But this does not require any programming.
You can simply run the same matching procedure on each data set via matchit() and then
feed the resulting multiple matched data sets into zelig().
Good luck,
Kosuke
Department of Politics
Princeton University
http://imai.princeton.edu
On Sep 13, 2011, at 6:02 PM, Pingaul jb wrote:
Dear Professor,
I’m a post-doctoral student at Montreal University. I’m actually in Columbia, working and
propensity scores with a colleague and using MatchIt and Zelig. First, congratulations for
your packages that are very flexible.
My question is about multiple imputation and propensity scores with these softwares. From
what I understand, combining both approaches would include:
1/ Doing multiple imputation and testing which variables to include.
2/ Propensity score analysis on each imputed data set and pooling the overall balance to
check if it is ok (or on each data set?).
3/ Calculation of the quantities of interest for each data set
4/ Pooling the quantities across data sets.
I would like to know if there is a written syntax to perform the MatchIt analysis for all
of the imputed data set without having to do it manually and check the overall balance.
Also, in theory, the number of individuals retained after propensity score matching and
the weights can be different for each imputed data set. So that we have to perform the
final analysis on each one and then pool the data with a specific procedure to take into
account the eventual varying Ns? I normally use Mice package for multiple imputation but
it seems that Zelig handle Amelia. My colleague seems to do be able to do all that in
stata, but I’m not sure how to make all the three R packages work together.
I would be very happy if you could indicate to me a reference or a place where I can find
the syntax to do that (I’ve been using R for some times so I can use packages easily but I
have no programming skills).
Best Regards!
Jean-Baptiste
<MatchItMI.txt><DataExample.csv>
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: