View source: R/create_diff_df.r
create_diff_df | R Documentation |
empty_diff_df.csv
Creates the empty_diff_df.csv
which lists all of the differences that
need to calculated at each silo in order to compute the aggregate ATT.
The empty_diff_df.csv
is then to be sent out to each silo to be filled out.
create_diff_df(
init_filepath,
date_format,
freq,
covariates = FALSE,
freq_multiplier = FALSE,
weights = "standard",
filename = "empty_diff_df.csv",
filepath = tempdir()
)
init_filepath |
A character filepath to the |
date_format |
A character specifying the date format used in the
|
freq |
A character indicating the length of the time periods to be used
when computing the differences in mean outcomes between periods at each
silo. Options are: |
covariates |
A character vector specifying covariates to be considered
at each silo. If |
freq_multiplier |
A numeric value or |
weights |
A character indicating the weighting to use in the case of
common adoption. The |
filename |
A character filename for the created CSV file. Defaults to
|
filepath |
Filepath to save the CSV file. Defaults to |
Ensure that dates in the init.csv
are entered consistently
in the same date format. Call undid_date_formats()
to see a list of valid
date formats. Covariates specified when calling create_diff_df()
will
override any covariates specified in the init.csv
.
A data frame detailing the silo and time combinations for which differences must be calculated in order to compute the aggregate ATT. A CSV copy is saved to the specified directory which is then to be sent out to each silo.
file_path <- system.file("extdata/staggered", "init.csv",
package = "undidR")
create_diff_df(
init_filepath = file_path,
date_format = "yyyy",
freq = "yearly"
)
unlink(file.path(tempdir(), "empty_diff_df.csv"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.