Estimate a causal quantity of interest, including the average treatment effect for
treated or control units (att and atc, respectively), the average effect of treatment reversal on reversed units (art), or average treatment effect (ate), as specified in PanelMatch()
.
This is done by estimating the counterfactual outcomes for each treated unit using
matched sets. Users will provide matched sets that were obtained by the
PanelMatch
function and obtain point estimates and standard errors.
PanelEstimate(
sets,
panel.data,
number.iterations = 1000,
df.adjustment = FALSE,
confidence.level = 0.95,
moderator = NULL,
se.method = "bootstrap",
pooled = FALSE,
include.placebo.test = FALSE,
parallel = FALSE,
num.cores = 1
)
PanelEstimate
returns a list of class
PanelEstimate
containing the following components:
the point estimates of the quantity of interest for the lead periods specified
The method used to calculate standard errors. This is the same as the argument provided to the function.
the bootstrapped point estimate values, when applicable
the number of iterations used in bootstrapping, when applicable
refinement method used to create the matched sets from which the estimates were calculated
See PanelMatch() argument lag
for more information.
The lead window sequence for which PanelEstimate()
is producing point estimates and standard errors.
the confidence level
the quantity of interest
the refined matched sets used to produce the estimations
the standard error(s) of the point estimates
Logical indicating whether or not estimates were calculated for individual lead periods or pooled.
if include.placebo.test = TRUE
, a placebo test is conducted using placebo_test()
and returned as a list. See documentation for placebo_test()
for more about each individual item.
A PanelMatch
object attained via the
PanelMatch()
function.
The same time series cross sectional data set provided to the PanelMatch()
function used to produce the matched sets. This should be a PanelData
object.
If using bootstrapping for calculating standard errors, this is the number of bootstrap iterations. Provide as integer. If se.method
is not equal to "bootstrap", this argument has no effect.
A logical value indicating whether or not a
degree-of-freedom adjustment should be performed for the standard error
calculation. The default is FALSE
. This parameter is only available for the bootstrap method of standard error calculation.
A numerical value specifying the confidence level and range of interval estimates for statistical inference. The default is .95.
The name of a moderating variable, provided as a character string. If a moderating variable is provided,the returned object will be a list of PanelEstimate
objects. The names of the list will reflect the different values of the moderating variable. More specifically, the moderating variable values will be converted to syntactically proper names using make.names()
.
Method used for calculating standard errors, provided as a character string. Users must choose between "bootstrap", "conditional", and "unconditional" methods. Default is "bootstrap". "bootstrap" uses a block bootstrapping procedure to calculate standard errors. The conditional method calculates the variance of the estimator, assuming independence across units but not across time. The unconditional method also calculates the variance of the estimator analytically, but makes no such assumptions about independence across units. When the quantity of interest is "att", "atc", or "art", all methods are available. Only "bootstrap" is available for the ate. If pooled
argument is TRUE, then only bootstrap is available.
Logical. If TRUE, estimates and standard errors are returned for treatment effects pooled across the entire lead window. Only available for se.method = ``bootstrap''
Logical. If TRUE, a placebo test is run and returned in the results. The placebo test uses the same specifications for calculating standard errors as the main results. That is, standard errors are calculated according to the user provided se.method
and confidence.level
arguments (and, if applicable, parallelization specifications).
Logical. If TRUE and se.method = ``bootstrap''
, bootstrap procedure will be parallelized. Default is FALSE. If se.method
is not set to bootstrap
, this option does nothing.
Integer. Specifies the number of cores to use for parallelization. If se.method = ``bootstrap''
and parallel = TRUE
, then this option will take effect. Otherwise, it will do nothing.
In Song Kim <insong@mit.edu>, Erik Wang <haixiao@Princeton.edu>, Adam Rauh <amrauh@umich.edu>, and Kosuke Imai <imai@harvard.edu>
Imai, Kosuke, In Song Kim, and Erik Wang (2023)
dem.sub <- dem[dem[, "wbcode2"] <= 100, ]
dem.sub.panel <- PanelData(dem.sub, "wbcode2", "year", "dem", "y")
# create subset of data for simplicity
PM.results <- PanelMatch(panel.data = dem.sub.panel, lag = 4,
refinement.method = "ps.match",
match.missing = TRUE,
covs.formula = ~ tradewb,
size.match = 5, qoi = "att",
lead = 0:4,
forbid.treatment.reversal = FALSE)
PE.results <- PanelEstimate(sets = PM.results,
panel.data = dem.sub.panel,
se.method = "unconditional")
Run the code above in your browser using DataLab