| Previous: U.N. Peacekeeping | Up: Identifying Common Support in | Next: Using WhatIf with Zelig |
To demonstrate that the latter approach really does combine the individual assessments of support on the treatment and control groups, consider this hypothetical data set:
> sqdata <- data.frame(t = c(1, 1, 1, 1, 0, 0, 0, 0), + x = c(0, 0, 1, 1, .5, .5, 1.5, 1.5), + y = c(1, 0, 0, 1, .5, 1.5, .5, 1.5))The variable `t' is the treatment. The convex hull of the observed covariate data of the treatment group is obviously a unit square with its lower left vertex at the origin. The convex hull of the control group is also a unit square, but one with its lower left vertex at the point
We first identify the control group units that are not on the support of the treated units (i.e., the control group units not in the convex hull of the covariate data of the treated group) as follows:
> summary(whatif(~ x + y, data = sqdata[sqdata$t == 1,], cfact = + sqdata[sqdata$t == 0,]))which as before uses the parameter formula to eliminate the treatment variable, t, from the data frames. Only the first unit from the control group, the point
> summary(whatif(~ x + y, data = sqdata[sqdata$t == 0,], cfact = + sqdata[sqdata$t == 1,]))The treatment group unit represented by the point
Alternatively, we can combine the two steps:
> summary(whatif(data = sqdata, cfact = cbind(1 - sqdata[, 1], sqdata[, 2:3])))This time, two counterfactuals are in the convex hull of the data. These counterfactuals correspond to the units with observed covariate data