View source: R/undid_stage_three.r
| undid_stage_three | R Documentation |
Takes in all of the filled diff df CSV files and uses them to compute group level ATTs as well as the aggregate ATT and its standard errors and p-values. Also takes in the trends data CSV files and uses them to produce parallel trends and event study plots.
undid_stage_three(
dir_path,
agg = "g",
weights = "both",
covariates = FALSE,
notyet = FALSE,
nperm = 999,
verbose = 100,
check_anon_size = FALSE,
hc = "hc3",
only = NULL,
omit = NULL,
max_attempts = 100
)
dir_path |
A character specifying the filepath to the folder containing all of the filled diff df CSV files. |
agg |
A character which specifies the aggregation methodology for
computing the aggregate ATT in the case of staggered adoption.
Options are: |
weights |
A string, determines which of the weighting methodologies
should be used. Options are: |
covariates |
A logical value (either |
notyet |
A logical value which declares if the not-yet-treated
differences from treated silos should be used as controls when computing
relevant sub-aggregate ATTs. Defaults to |
nperm |
Number of random permutations of treatment assignment to use
when calculating the randomization inference p-value. Defaults to |
verbose |
A numeric value (or |
check_anon_size |
A logical value, which if |
hc |
Specify which heteroskedasticity-consistent covariance matrix
estimator (HCCME) should be used. Options are |
only |
A character vector of silos to include. Defaults to |
omit |
A character vector of silos to omit. Defaults to |
max_attempts |
A numeric value. Sets the maximum number of attempts
to find a new unique random permutations during the randomization
inference procedure. Defaults to |
An UnDiDObj with S3 methods of summary(), plot(),
print(), and coef().
# Execute `undid_stage_three()`
dir <- system.file("extdata/staggered", package = "undidR")
# Recommended: nperm >= 399 for reasonable precision
# (~15 seconds on typical hardware)
result <- undid_stage_three(dir, agg = "g", nperm = 399, verbose = NULL)
# View the summary of results
summary(result)
# View the parallel trends plot
plot(result)
# View the event study plot
plot(result, event = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.