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.
undid_stage_three(
dir_path,
agg = "silo",
weights = TRUE,
covariates = FALSE,
interpolation = FALSE,
save_csv = FALSE,
filename = "UNDID_results.csv",
filepath = tempdir(),
nperm = 1001,
verbose = TRUE
)A data frame containing the aggregate ATT and its
standard errors and p-values from two-sided tests of agg_ATT == 0.
Also returns group (silo, g, or gt) level ATTs for staggered adoption.
A character specifying the filepath to the folder containing all of the filled diff df CSV files.
A character which specifies the aggregation methodology for
computing the aggregate ATT in the case of staggered adoption.
Options are: "silo", "g", or "gt". Defaults to "silo".
A logical value (either TRUE or FALSE) which determines
whether or not the weights should be used in the case of common adoption.
Defaults to TRUE.
A logical value (either TRUE or FALSE) which specifies
whether to use the diff_estimate column or the diff_estimate_covariates
column from the filled diff df CSV files when computing ATTs.
A logical value or a character which specifies which,
if any, method of interpolation/extrapolation for missing values of
diff_estimate or diff_estimate_covariates should be used.
There must be at least one diff_estimate or diff_estimate_covariates
value for the (silo,g) group for which a missing value is being estimated
in order for interpolation to work. Options are: "linear_function",
"nearest_value", or "piecewise_linear". Defaults to FALSE.
A logical value, either TRUE or FALSE (default),
which determines if a CSV copy of the UNDID results will be saved or not.
A string filename for the created CSV file.
Defaults to "UNDID_results.csv"
Filepath to save the CSV file. Defaults to tempdir().
Number of random permutations of gvar & silo pairs to consider
when calculating the randomization inference p-value. Defaults to 1001.
A logical value (either TRUE or FALSE) which toggles
messages showing the progress of the randomization inference.
Defaults to TRUE.
The agg parameter specifies the aggregation method used in the
case of staggered adoption. By default it is set to "silo" so that the ATTs
are aggregated across silos with each silo having equal weight, but can be
set to "gt" or "g" instead. Aggregating across "g" calculates ATTs for
groups based on when the treatment time was, with each "g" group having
equal weight. Aggregating across "gt" calculates ATTs for groups based on
when the treatment time was and the time for which the ATT is calculated.
The agg parameter is ignored in the case of a common treatment time and
only takes effect in the case of staggered adoption. For common adoption,
refer to the weights parameter.
# Execute `undid_stage_three()`
dir <- system.file("extdata/staggered", package = "undidR")
undid_stage_three(dir, agg = "g", nperm = 501, verbose = FALSE)
Run the code above in your browser using DataLab