# Calculating average treatment effect for propensity score matching with MatchIt and Zelig packages in R

Using the lalonde dataset provided with the MatchIt package, I'm running the following R commands (from the subclassification example code on the author's website: http://r.iq.harvard.edu/docs/matchit/2.4-20/Examples2.html) to find the average treatment effect (ATE) for the re78 income variable via subclassification propensity score matching:

library(MatchIt)
library(Zelig)

m.out2 <- matchit(treat ~ age + educ + black + hispan + nodegree +
married + re74 + re75, data = lalonde,
method = "subclass", subclass = 4)

z.out3 <- zelig(re78 ~ re74 + re75 + distance,
data = match.data(m.out2, "control"),
model = "ls", by = "subclass")

x.out3 <- setx(z.out3, data = match.data(m.out2, "treat"), fn = NULL,
cond = TRUE)

s.out3 <- sim(z.out3, x = x.out3)

summary(s.out3)
sim x :
-----
ev
mean       sd      50%     2.5%    97.5%
1 7403.842 350.7007 7413.838 6745.717 8098.868
pv
mean       sd      50%      2.5%    97.5%
[1,] 7491.131 6787.782 7329.752 -5936.341 20942.52

sim x :
-----
ev
mean       sd      50%     2.5%   97.5%
1 4138.609 1170.197 4145.441 1872.314 6448.79
pv
mean       sd      50%      2.5%    97.5%
[1,] 4157.933 5797.371 4031.378 -7585.696 15198.53

sim x :
-----
ev
mean       sd      50%     2.5%    97.5%
1 4108.98 845.9136 4073.592 2415.578 5804.729
pv
mean       sd      50%     2.5%   97.5%
[1,] 3910.667 4366.467 3914.451 -4408.87 12145.8

sim x :
-----
ev
mean       sd      50%     2.5%    97.5%
1 6306.787 1656.057 6309.035 3035.061 9521.649
pv
mean       sd      50%      2.5%    97.5%
[1,] 6318.831 6635.518 6652.653 -7352.725 18704.96

The code runs without error, however I don't understand the output from summary(s.out3) and the documentation is unhelpful. Are the four mean ev values equal to the expected ATEs for each of the four subclasses? Where is the ATE averaged over all four subclasses?

• Is there a chance you answer your own question on this? I am sure people will find it helpful as Zelig's documentation is indeed patchy at this point. – usεr11852 Jun 15 '17 at 19:08