# Bootstrap
set.seed(60637)
niter <- 1000
boot_est <- rep(NA, niter)
for(i in 1:niter){
boot_minwage <- minwage[sample(1:nrow(minwage), nrow(minwage), replace=T),]
# Fit a propensity score model
weight_model_boot <- glm(STATE ~ as.factor(CHAIN), data=boot_minwage, family=binomial(link="logit"))
# Predict weights
boot_minwage$e <- predict(weight_model_boot, type="response")
boot_minwage$did_wt <- (1/mean(boot_minwage$STATE)) * ((boot_minwage$STATE - boot_minwage$e)/(1-boot_minwage$e))
# Point est
boot_est[i] <- mean(boot_minwage$CHG_EMPFT*boot_minwage$did_wt)
}
#Bootstrap 95% CI
quantile(boot_est, c(.025, .975))