I'm using the Match() library in R, and I need CI for ATT.
Is there a way to get it? I want to use propensity scores while calculating ATT and CI.
How it'd be calculated? (i.e. what would be the formula and why?)
Cheers,
PS: I looked on those, but it wasn't quite what I was looking for: https://stats.stackexchange.com/questions/132509/confidence-interval-for-average-treatment-effect-from-propensity-score-weighting
PS2: Relevant piece of code attached; after finding balance, I try to obtain CIs with the regression+confint() method but it doesn't work because I don't know how to pass propensity scores and I force into regression model (I'm sure it's unnecessary, but I know only the confint function for CIs).
(3) Using the Match() help file code example as a guide, use propensity score matching to produce an estimated treatment effect and confidence interval. Report your results.
```{r}
library(Matching)
DataFrame=as.data.frame(data1)
# Estimate the propensity model
glm1 <- glm(treat~age + I(age^2) + education + I(education^2) + black +
hispanic + married + nodegree + re74 + I(re74^2) + re75 + I(re75^2) , family=binomial, data=DataFrame)
#save data objects
X <- glm1$fitted
Y <- DataFrame$re78
Tr <- DataFrame$treat
# One-to-one matching with replacement (the "M=1" option).
# Estimating the treatment effect on the treated (the "estimand" option defaults to ATT==Average Treatment effect for Treated).
rr <- Match(Y=Y, Tr=Tr, X=X, M=1);
summary(rr)
```
Finding Balance:
```{r}
# Let's check the covariate balance:
mb <- MatchBalance(treat~age + I(age^2) + education + I(education^2) + black +hispanic + married + nodegree + re74 + I(re74^2) + re75 + I(re75^2), data=DataFrame, match.out=rr, nboots=500)
rr1 <- Match(Y=Y, Tr=Tr, X=X, M=1,Weight.matrix=);
#After obtaining balance, find ATT
rr1 <- Match(Y=Y, Tr=Tr, X=X, M=1);
summary(rr1)
```
Find a way to obtain CIs - Doesnt work:
```{r}
X<-mb
Y<-re78
RegressionOnMatched<-lm(re78~X,data = )
confint(RegressionOnMatched)
#mean(rr$re78)
#quantile(rr$re78, c(0.025, 0.975))
```