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
>
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/
*Please, let me know how can I install ZeligMultinomial package. I want to
use mlogit, which according to the manual (page 50), is found in said
package.
I tried with the command,
install.packages("ZeligMultinomial", repos="http://r.iq.harvard.edu/",
type="source")
But received the following message:
Warning: dependency 'MNP' is not available
trying URL '
http://r.iq.harvard.edu/src/contrib/ZeligMultinomial_0.5-4.tar.gz'
Content type 'application/x-gzip' length 9730 bytes
opened URL
==================================================
downloaded 9730 bytes
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_PAPER failed, using "C"
ERROR: dependency 'MNP' is not available for package 'ZeligMultinomial'
* removing
'/Library/Frameworks/R.framework/Versions/2.14/Resources/library/ZeligMultinomial'
The downloaded packages are in
'/private/var/folders/UL/ULLu+bi5GR8IM1G-7XZBJU+++TI/-Tmp-/Rtmp6jw6M9/downloaded_packages'
Warning message:
In install.packages("ZeligMultinomial", repos = "http://r.iq.harvard.edu/",
:
installation of package 'ZeligMultinomial' had non-zero exit status
***
hi Zeliglist
I've seen this question come up on the list before but can't find an
answer. When supplying a vector of x values to a logit.gam model, Zelig
(3.5.5, in R 2.15) throws the following error:
Error in coef %*% t(x) : non-conformable arguments
error. This is not consistent with the behavior of a logit model, which
provides estimates of results in this situation. To provide a reproducible
example:
set.seed(0)
> n <- 400
> x0 <- runif(n, 0, 1)
> x1 <- runif(n, 0, 1)
> y <- rbinom(n, 1,.25)
> dat <- as.data.frame(cbind(y, x0, x1))
> z.out <- zelig(y ~ s(x0) + s(x1), model = "logit.gam",
> data = dat)
> x1r <- seq(quantile(dat$x1, .2),
> quantile(dat$x1, .8),
> length.out = 100)
> x.1 <- setx(z.out,
> x0 = mean(dat$x0),
> x1 = x1r)
> x.2 <- setx(z.out,
> x0 = mean(dat$x0)+ sd(dat$x0),
> x1 = x1r)
>
> z.res <- sim(z.out, x = x.1, x1 = x.2)
But the "logit" model accepts vectors of x values--is there fundamental
mistake I'm making, or this just a limitation of GAMs themselves?
Thanks
Tom
I used the install method you suggested and was successful, but the version
that was installed didn't include about half of the models that Zelig uses
(e.g., Relogit).
Thanks
______________________________________
CONFIDENTIALITY NOTE: This communication may contain confidential information.
If you are not the intended recipient or if you are not authorized to receive it, please
notify and return the message to the sender. Unauthorized reviewing, forwarding,
copying, distributing or using this information is strictly prohibited.
Recently, I was trying to use Zelig to calculate ATEs from a
straightforward logit model. In other words, rather than calculating
first differences as a marginal effect at the means (i.e., for a
respondent whose scores on the covariates are equal to the sample means
of those variables), I wanted the quantity calculated as the average
difference in predicted probability across all respondents, using their
actual values of the covariates. Although the documentation says that I
should be able to get such a quantity through s.out$qi$ate.pr or
s.out$qi$ate.ev, I couldn't extract those quantities. At first I
thought that this was just an oversight peculiar to the logit model, but
it was also the case for a mixed-effects logit. The only elements that
were attached to my sim() object were:
[1] "x" "x1" "call" "zelig.call" "par"
[6] "qi$ev" "qi$pr" "qi$rr" "qi$fd"
Is there any chance that the ATE quantities were accidentally dropped
from a recent version, or am I doing something wrong?
Thanks,
Mike Hoffman
I am having trouble using relogit when the response is a two column matrix
(first column for #successes and the second for #failures).
When i try:
z.out <- zelig(cbind(suc, nosuc) ~ loc, model="logit", data=myData)
it works but when i try
z.out <- zelig(cbind(suc, nosuc) ~ loc, model="relogit", data=myData),
I get the error "Error in eval(expr, envir, enclos) :
for the binomial family, y must be a vector of 0 and 1'
or a 2 column matrix where col 1 is no. successes and col 2 is no. failures"
(myData is:
loc suc nosuc
0 0.0000000 5 493064
1 0.6931472 2 68832
2 1.0986123 0 5741
3 1.3862944 0 609
)
Is relogit not working with this format or am I doing something wrong?