So following the example from the Matching package and in particular the GenMatch example. This continues on from a previous question
Following the example in GenMatch
library(Matching)
data(lalonde)
attach(lalonde)
X = cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74)
BalanceMat <- cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74,
I(re74*re75))
genout <- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATE", M=1,
pop.size=16, max.generations=10, wait.generations=1)
genout$matches
genout$ecaliper
Y=re78/1000
mout <- Match(Y=Y, Tr=treat, X=X, Weight.matrix=genout)
summary(mout)
We see 185 treated observation are paired with 270 non-treatment observation.
We can generate a table with the treatment cases and their age on the left and the control case and age on the right by:
pairs <- data.frame(mout$index.treated, lalonde$age[mout$index.treated], mout$index.control, lalonde$age[mout$index.control])
Now, the literature about the Weight.Matrix
generated from GenMatch
is very cryptic and doesn't explain what these values represent. I have an open question here. Now lets say we want to relax the matching so that more flexible pairing on the age criteria occurs.
We see that sd(lalonde$age)
gives us a SD of 7 years for our data.
So I want the Weight.matrix
to account for this. I want to use a limit of 1 SD for the age
variable and thus return more pairs then the original 185-270.
My guess is to generate a second GenMatch
function then continue with my code. So I use:
genout <- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATE",
pop.size=1000, max.generations=10, wait.generations=1,
caliper=c(2,1,1,1,1,1,1,1,1,1))
But this does not significantly increase the number of pairs I return.
Any hints or solutions where I am going wrong