attcpo | R Documentation |
compute the Average Treatment Effect on the Treated Conditional on the previous outcome (ATT-CPO)
attcpo( formla, t, tmin1, tmin2, tname, data, idname, Y0tqteobj, h = NULL, yseq = NULL, yseqlen = 100, se = TRUE, iters = 100, method = "level" )
formla |
e.g. y ~ treat |
t |
the last time period |
tmin1 |
the middle time period |
tmin2 |
the first time period |
tname |
the name of the column containing time periods in the data |
data |
a data.frame |
idname |
the name of the column containing an individual identifier over time |
Y0tqteobj |
a qte object (from the qte package) containing the the counterfactual distribution of untreated potential outcomes for the treated group |
h |
optional bandwidth |
yseq |
optional sequence of y values, default is to use all unique yvalues in the data, though this can increase computation time |
yseqlen |
optional length of y values to use, aids in automatically generating yseq if desired |
se |
whether or not to compute standard errors |
iters |
how many bootstrap iterations to use if computing standard errors; default is 100. |
method |
should be either "levels" or "rank"; whether to compute the ATT-CPO using based on the levels of Y0tmin1 or the ranks of Y0tmin1; "levels" is the default. |
att-cpo
data(displacements) cc <- qte::CiC(learn ~ treat, t=2011, tmin1=2007, tname="year", idname="id", panel=TRUE, data=displacements, probs=seq(.05,.95,.01),se=FALSE) cc$F.treated.tmin1 <- ecdf(subset(displacements, year==2007 & treat==1)$learn) cc$F.treated.tmin2 <- ecdf(subset(displacements, year==2003 & treat==1)$learn) ac <- attcpo(learn ~ treat, 2011, 2007, 2003, "year", displacements, "id", cc, method="rank", yseqlen=10) ac ggattcpo(ac)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.