| placebo_test | R Documentation |
Calculate the results of a placebo test, looking at the change in outcome at time = t-1, compared to other pre-treatment periods in the lag window. Users may notice small differences in results returned by PanelMatch() when placebo.test = TRUE versus when placebo.test = FALSE, even if the specifications are otherwise identical. This is because placebo tests require the presence of outcome data for units over the lag window, which is not a default requirement. As a result, when placebo.test = TRUE, the size and number of matched sets might be reduced.
placebo_test(
pm.obj,
panel.data,
lag.in = NULL,
number.iterations = 1000,
confidence.level = 0.95,
plot = FALSE,
se.method = "bootstrap",
parallel = FALSE,
num.cores = 1,
...
)
pm.obj |
an object of class |
panel.data |
|
lag.in |
integer indicating earliest the time period(s) in the future for which the placebo test change in outcome will be calculated. Calculations will be made over the period t - max(lag) to t-2, where t is the time of treatment. The results are similar to those returned by |
number.iterations |
integer specifying the number of bootstrap iterations. This argument only has an effect if standard errors are calculated with the bootstrap. |
confidence.level |
confidence level for the calculated standard error intervals. Should be specified as a numeric between 0 and 1. |
plot |
logical indicating whether or not a plot should be generated, or just return the raw data from the calculations |
se.method |
character string describing the type of standard error to be used. Valid inputs include "bootstrap", "conditional" and "unconditional". When the QOI is ATE, only bootstrap can be used. See the documentation of this argument in |
parallel |
Logical. If TRUE and |
num.cores |
Integer. Specifies the number of cores to use for parallelization. If |
... |
extra arguments to be passed to |
list with 3 or 4 elements: "estimates", which contains the point estimates for the test, "standard.errors" which has the standard errors for each period, "conf.intervals", a matrix giving the confidence interval bounds for each period (calculated via confint.PanelEstimate() at the confidence.level specified), and optionally "bootstrapped.estimates", containing the bootstrapped point estimates for the test for each specified lag window period.
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, placebo.test = TRUE)
placebo_test(PM.results, panel.data = dem.sub.panel, se.method = "unconditional", plot = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.