To install the appropriate version, Zelig 3.5, run:
install.packages("Zelig")
from your R-prompt. Zelig 4 will be supporting average treatment effects in an upcoming
patch.
On Aug 20, 2012, at 5:19 PM, Seth Leon wrote:
Hello,
I would like to calculate an average treatment effect on treated cases using
Matchit and Zelig in R. Last week I ran into a problem when Matchit produces a
weighted file rather than a 1 to 1 match. I worked out the follwoing work around
in R, that was working last week. I was able to obtain the conditional
treatments effects I was seeking.
logv =c(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE
,TRUE, TRUE, TRUE, FALSE)
msmatch <- matchit(contew ~ blk + hisp+ white + nFRM0910 + nELL0910 + ZMath0910
+ ZRead0910 + ZWrite0910 + gr3 + gr4 + gr5 + ngend0910,data=msdata,
method="genetic",replace =TRUE,ratio=2,
exact=logv,pop.size=700,estimand="ATT")
msmatchdata <- match.data(msmatch)
z.out <- zelig(ZRead1011 ~ ZMath0910 + ZRead0910 + ZWrite0910 ,
data = match.data(msmatch, "control"), model = "ls",
weights="weights")
z.out2 <- zelig(ZRead1011 ~ ZMath0910 + ZRead0910 + ZWrite0910 ,
data = match.data(msmatch, "control"), model = "ls")
z.out$call<-z.out2$call
summary(z.out)
x.out1 <- setx(z.out, data = match.data(msmatch, "treat"), cond = TRUE)
s.out <- sim(z.out, x = x.out1)
summary(s.out)
It looks my Zelig version was updated as now when I run the same code I get the
warning message:
In setx.default(z.out, data = match.data(msmatch, "treat"), cond = TRUE) :
"cond" is not currently supported by this version of Zelig
Is anyone familiar with the reason why conditional prediction is no longer
supported with the more recent Zelig version?
Many thanks in advance!
-
--
Zelig Mailing List, served by HUIT
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information:
http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig(a)lists.gking.harvard.edu
https://lists.gking.harvard.edu/mailman/listinfo/zelig