IQSS / Zelig

A statistical framework that serves as a common interface to a large range of models
http://zeligproject.org
110 stars 43 forks source link

ATT doesn't report SE or CI #310

Closed christophergandrud closed 7 years ago

christophergandrud commented 7 years ago

From Eric Meng via email:

"I estimate ATT through the command “ATT”... However, it only yields estimates of mean, median, and IQR without SE or 95%CI. Is there a way to deal with that?"

christophergandrud commented 7 years ago

att + get_qi returns a vector of the simulated values for this quantity of interest.

For example,

library(zeligverse)
library(dplyr) # load %>% pipe operator

# load data and estimate model
data(sanction)
zqi.out <- zelig(num ~ target + coop + mil, 
                 model = "poisson", data = sanction, cite = FALSE)

# find the ATT where the treatement is mil = 1
z.att <- zqi.out %>%
    ATT(treatment = "mil", treat = 1) %>% 
    get_qi(qi = "ATT", xvalue = "TE")

head(z.att)
## -8.822828 -7.374883 -7.343523 -6.713210 -7.026924 -7.185858

When you run summary on this, the normal base-R summary returns its normal summary statistics (e.g. IQR).

You can find other summary statistics using the standard methods for a vector of values. For example, standard error of the mean:

sd(z.att) / sqrt(length(z.att))
## 0.02020344