I think this question might actually be more about Zelig so you might want to post it on
the Zelig list.
Liz
On May 2, 2017, at 11:09 AM, 周宛誼
<mayritaspring@gmail.com<mailto:mayritaspring@gmail.com>> wrote:
Dear all,
May I ask a question about package: MatchIt (version 2.4-22) in R(3.3.2)?
When I want to calculate ate by the code below, it doesn't work. Could you help me
solve the problem? Because when I run
s.out1$qi$att.ev, it comes the error:
Error in s.out1$qi$att.ev : object of type 'closure' is not subsettable
I think it can not find qi object in s.out1 because it's a function? So I can't
call the object att.ev from qi? Do you have any suggestion for calculating ate?
The code is below:
m.out1 <- matchit(treat ~ age + educ + black + hispan + nodegree +
married + re74 + re75, method = "nearest", data = lalonde)
z.out1 <- zelig(re78 ~ age + educ + black + hispan + nodegree +
married + re74 + re75, data = match.data(m.out1, "control"),
model = "ls")
x.out1 <- setx(z.out1, data = match.data(m.out1, "treat"), cond = TRUE)
s.out1 <- sim(z.out1, x = x.out1)
z.out2 <- zelig(re78 ~ age + educ + black + hispan + nodegree +
married + re74 + re75, data = match.data(m.out1, "treat"),
model = "ls")
x.out2 <- setx(z.out2, data = match.data(m.out1, "control"), cond = TRUE)
s.out2 <- sim(z.out2, x = x.out2)
ate.all <- c(s.out1$qi$att.ev, -s.out2$qi$att.ev)
Thank you so much
Best,
Wan-Yi,Chou
[
http://www.debutworkshop.org/wp-content/uploads/2015/08/nctu_logo.png]
Wan-Yi Chou (May Chou), Master
Management Science, National Chiao Tung University
國立交通大學管理科學研究所
周宛誼|Email mayritaspring@gmail.com<mailto:mayritaspring@gmail.com>
--
[
http://www.debutworkshop.org/wp-content/uploads/2015/08/nctu_logo.png]
Wan-Yi Chou (May Chou), Master
Management Science, National Chiao Tung University
國立交通大學管理科學研究所
周宛誼|Email mayritaspring@gmail.com<mailto:mayritaspring@gmail.com>
-
---
MatchIt mailing list served by HUIT
List Address:
matchit@lists.gking.harvard.edu<mailto:matchit@lists.gking.harvard.edu>
Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/mailman/listinfo/ei
MatchIt Software and Documentation:
http://gking.harvard.edu/matchit/
Browse/Search List Archive:
http://lists.gking.harvard.edu/mailman/private/matchit/
Matchit mailing list
Matchit@lists.gking.harvard.edu<mailto:Matchit@lists.gking.harvard.edu>
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/matchit