panel.qtet computes the Quantile Treatment Effect on the Treated (QTET) using the method of Callaway and Li (2015). This method should be used when the researcher wants to invoke a Difference in Differences assumption to identify the QTET. Relative to the other Difference in Differences methods available in the qte package, this method's assumptions are more intuitively similar to the identifying assumptions used in identifying the Average Treatment Effect on the Treated (ATT).

Additionally, this method can accommodate covariates in a more flexible way than the other Difference in Differences methods available. In order to accommodate covariates, the user should specify a vector x of covariate names. The user also may specify a method for estimating the propensity score. The default is logit.

panel.qtet can only be used in some situations, however. The method requires three periods of panel data where individuals are not treated until the last period. The data should be formatted as a panel; the names of columns containing time periods and ids for each cross sectional unit need to be passed to the method.

panel.qtet(
  formla,
  xformla = NULL,
  t,
  tmin1,
  tmin2,
  tname,
  data,
  idname,
  probs = seq(0.05, 0.95, 0.05),
  iters = 100,
  alp = 0.05,
  method = c("qr", "pscore"),
  se = TRUE,
  retEachIter = FALSE,
  pl = FALSE,
  cores = NULL
)

Arguments

formla

The formula y ~ d where y is the outcome and d is the treatment indicator (d should be binary), d should be equal to one in all time periods for individuals that are eventually treated

xformla

A optional one sided formula for additional covariates that will be adjusted for. E.g ~ age + education. Additional covariates can also be passed by name using the x paramater.

t

The 3rd time period in the sample. Treated individuals should be treated in this time period and untreated individuals should not be treated. The code attempts to enforce this condition, but it is good try to handle this outside the panel.qtet method.

tmin1

The 2nd time period in the sample. This should be a pre-treatment period for all individuals in the sample.

tmin2

The 1st time period in the sample. This should be a pre-treatment period for all individuals in the sample.

tname

The name of the column containing the time periods

data

A data.frame containing all the variables used

idname

The individual (cross-sectional unit) id name

probs

A vector of values between 0 and 1 to compute the QTET at

iters

The number of iterations to compute bootstrap standard errors. This is only used if se=TRUE

alp

The significance level used for constructing bootstrap confidence intervals

method

The method for including covariates, should either be "QR" for quantile regression or "pscore" for propensity score

se

Boolean whether or not to compute standard errors

retEachIter

Boolean whether or not to return list of results from each iteration of the bootstrap procedure (default is FALSE). This is potentially useful for debugging but can cause errors due to running out of memory.

pl

Whether or not to compute standard errors in parallel

cores

Number of cores to use if computing in parallel

Value

QTE object

References

Callaway, Brantly and Tong Li. ``Quantile Treatment Effects in Difference in Differences Models with Panel Data.'' Working Paper, 2019.

Examples

##load the data
data(lalonde)

## Run the panel.qtet method on the experimental data with no covariates
pq1 <- panel.qtet(re ~ treat, t=1978, tmin1=1975, tmin2=1974, tname="year",
 data=lalonde.exp.panel, idname="id", se=FALSE,
 probs=seq(0.05, 0.95, 0.05))
#> Warning: covariates appear to vary over time...
#>   only conditioning on first period covariates...
#>   this is recommended practice, but worth noting...
summary(pq1)
#> 
#> Quantile Treatment Effect:
#> 		
#> tau	QTE
#> 0.05	-1632.35
#> 0.1	-2298.01
#> 0.15	-3413.76
#> 0.2	-8616.01
#> 0.25	-8130.78
#> 0.3	-7672.96
#> 0.35	-7110.02
#> 0.4	-6278.18
#> 0.45	-5200.26
#> 0.5	-4383.70
#> 0.55	-3585.33
#> 0.6	-2422.61
#> 0.65	-1188.12
#> 0.7	 -451.94
#> 0.75	 1026.99
#> 0.8	  894.78
#> 0.85	 1251.89
#> 0.9	 1119.72
#> 0.95	 2808.86
#> 
#> Average Treatment Effect:	1529.20

## Run the panel.qtet method on the observational data with no covariates
pq2 <- panel.qtet(re ~ treat, t=1978, tmin1=1975, tmin2=1974, tname="year",
 data=lalonde.psid.panel, idname="id", se=FALSE,
 probs=seq(0.05, 0.95, 0.05))
#> Warning: covariates appear to vary over time...
#>   only conditioning on first period covariates...
#>   this is recommended practice, but worth noting...
summary(pq2)
#> 
#> Quantile Treatment Effect:
#> 		
#> tau	QTE
#> 0.05	 4779.21
#> 0.1	 1987.35
#> 0.15	  842.95
#> 0.2	-7366.04
#> 0.25	-8449.96
#> 0.3	-7992.15
#> 0.35	-7429.21
#> 0.4	-6597.37
#> 0.45	-5519.45
#> 0.5	-4702.88
#> 0.55	-3904.52
#> 0.6	-2741.80
#> 0.65	-1507.31
#> 0.7	 -771.12
#> 0.75	  707.81
#> 0.8	  580.00
#> 0.85	  821.75
#> 0.9	 -250.77
#> 0.95	-1874.54
#> 
#> Average Treatment Effect:	2326.51

## Run the panel.qtet method on the observational data conditioning on
## age, education, black, hispanic, married, and nodegree.
## The propensity score will be estimated using the default logit method.
pq3 <- panel.qtet(re ~ treat, t=1978, tmin1=1975, tmin2=1974, tname="year",
 xformla=~age + I(age^2) + education + black + hispanic + married + nodegree,
 data=lalonde.psid.panel, idname="id", se=FALSE, method="pscore",
 probs=seq(0.05, 0.95, 0.05))
#> Warning: covariates appear to vary over time...
#>   only conditioning on first period covariates...
#>   this is recommended practice, but worth noting...
summary(pq3)
#> 
#> Quantile Treatment Effect:
#> 		
#> tau	QTE
#> 0.05	 2953.75
#> 0.1	 1762.13
#> 0.15	  630.91
#> 0.2	-7254.06
#> 0.25	-6768.83
#> 0.3	-6311.01
#> 0.35	-5748.07
#> 0.4	-4916.23
#> 0.45	-3838.31
#> 0.5	-3021.75
#> 0.55	-2223.38
#> 0.6	-1060.66
#> 0.65	  173.83
#> 0.7	  910.01
#> 0.75	 2388.94
#> 0.8	 2526.64
#> 0.85	 2949.64
#> 0.9	 1629.48
#> 0.95	 3160.67
#> 
#> Average Treatment Effect:	-119556.31

pq4 <- panel.qtet(re ~ treat, t=1978, tmin1=1975, tmin2=1974, tname="year",
 xformla=~age + I(age^2) + education + black + hispanic + married + nodegree,
 data=lalonde.psid.panel, idname="id", se=FALSE, method="qr",
 probs=seq(0.05, 0.95, 0.05))
#> Warning: covariates appear to vary over time...
#>   only conditioning on first period covariates...
#>   this is recommended practice, but worth noting...
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
#> Warning: Solution may be nonunique
summary(pq4)
#> 
#> Quantile Treatment Effect:
#> 		
#> tau	QTE
#> 0.05	    0.00
#> 0.1	    0.00
#> 0.15	 -218.70
#> 0.2	-2159.20
#> 0.25	-2538.65
#> 0.3	-3378.66
#> 0.35	-3370.51
#> 0.4	-2922.88
#> 0.45	-2107.04
#> 0.5	-1935.37
#> 0.55	-1180.00
#> 0.6	  -88.03
#> 0.65	 1044.11
#> 0.7	 1514.30
#> 0.75	 2535.14
#> 0.8	 2633.73
#> 0.85	 3312.16
#> 0.9	 3174.61
#> 0.95	 2847.76
#> 
#> Average Treatment Effect:	401.65