data(mexico)
loyal <- mexico[mexico$mex.loyal == 1,]
notloyal <- mexico[mexico$mex.loyal == 0,]
if (FALSE) {
## Logistic outcome regression
## (effect of vote-selling on turnout)
## This replicates Table 4 in Imai et al. 2014
loyalreg <- ictreg.joint(formula = mex.y.all ~ mex.male + mex.age + mex.age2 + mex.education +
mex.interest + mex.married +
mex.wealth + mex.urban + mex.havepropoganda + mex.concurrent, data = loyal,
treat = "mex.t", outcome = "mex.votecard", J = 3, constrained = TRUE,
outcome.reg = "logistic", maxIter = 1000)
## Linear outcome regression
## (effect of vote-selling on candidate approval)
## This replicates Table 5 in Imai et al. 2014
approvalreg <- ictreg.joint(formula = mex.y.all ~ mex.male + mex.age + mex.age2 +
mex.education +
mex.interest + mex.married +
mex.urban +
mex.cleanelections + mex.cleanelectionsmiss +
mex.havepropoganda +
mex.wealth + mex.northregion +
mex.centralregion + mex.metro + mex.pidpriw2 +
mex.pidpanw2 + mex.pidprdw2,
data = mexico, treat = "mex.t", outcome = "mex.epnapprove",
J = 3, constrained = TRUE,
outcome.reg = "linear", maxIter = 1000)
summary(approvalreg)
## Generate predicted probability of turnout, averaged over the whole sample,
## for vote sellers (z = 1), non-vote sellers (z = 0), and the difference
## between vote sellers and non-vote sellers, in the sample of party supporters.
## This replicates the results in the righthand panel of Figure 2 in Imai et al. 2014
loyalpred <- predict.ictreg.joint(loyalreg, se.fit = TRUE, interval = "confidence",
level = 0.95, avg = TRUE,
sensitive.value = "both",
sensitive.diff = TRUE, return.draws = TRUE,
predict.sensitive = TRUE)
loyalpred$fit
## View predicted probability of vote selling, in the sample of party supporters.
## This replicates the results in the lefthand panel of Figure 2 in Imai et al. 2014
loyalpred$fitsens
}
Run the code above in your browser using DataLab