Skip to content

Instantly share code, notes, and snippets.

@diamonaj
Last active November 5, 2019 06:19
Show Gist options
  • Select an option

  • Save diamonaj/3b6bc83d040098486634184d99fc4c55 to your computer and use it in GitHub Desktop.

Select an option

Save diamonaj/3b6bc83d040098486634184d99fc4c55 to your computer and use it in GitHub Desktop.
genout <- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATT", exact = TRUE, M=1,
pop.size=16, max.generations=10, wait.generations=1)
#The outcome variable
Y=re78/1000
#
# Now that GenMatch() has found the optimal weights, let's estimate
# our causal effect of interest using those weights
#
mout <- Match(Y=Y, Tr=treat, X=X, Weight.matrix=genout)
summary(mout)
#
#Let's determine if balance has actually been obtained on the variables of interest
#
mb <- MatchBalance(treat~age +educ+black+ hisp+ married+ nodegr+ u74+ u75+
re75+ re74+ I(re74*re75),
match.out=mout, nboots=500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment