placebo_test: placebo_test

View source: R/utilities.R

placebo_testR Documentation

placebo_test

Description

Calculates results for a placebo test

Usage

placebo_test(
  pm.obj,
  data,
  lag.in = NULL,
  number.iterations = 1000,
  confidence.level = 0.95,
  plot = FALSE,
  ...
)

Arguments

pm.obj

an object of class PanelMatch

data

data.frame with the original 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 PanelEstimate, except t-1 is used as the period of comparison, rather than the lead window.

number.iterations

integer specifying the number of bootstrap iterations

confidence.level

confidence level for the calculated standard error intervals

plot

logical indicating whether or not a plot should be generated, or just return the raw data from the calculations

...

extra arguments to be passed to plot

Details

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.

Value

list with 2 elements: "estimates", which contains the point estimates for the test and "bootstrapped.estimates", containing the bootstrapped point estimates for the test for each specified lag window period.

Examples

PM.results <- PanelMatch(lag = 4, time.id = "year", unit.id = "wbcode2",
                         treatment = "dem", refinement.method = "mahalanobis",
                         data = dem, match.missing = TRUE,
                         covs.formula = ~ I(lag(tradewb, 1:4)),
                         size.match = 5, qoi = "att",
                         outcome.var = "y", lead = 0:4, forbid.treatment.reversal = FALSE,
                         placebo.test = TRUE)
placebo_test(PM.results, data = dem, number.iterations = 100, plot = FALSE)



PanelMatch documentation built on June 27, 2022, 1:06 a.m.