DiSCoTEA {DiSCos} | R Documentation |
Aggregate treatment effects from DiSCo function.
Description
Function to aggregate treatment effects from the output of the DiSCo function, plot the distribution of the aggregation statistic over time, and report summary tables.
Usage
DiSCoTEA(
disco,
agg = "quantileDiff",
graph = TRUE,
t_plot = NULL,
savePlots = FALSE,
xlim = NULL,
ylim = NULL,
samples = c(0.25, 0.5, 0.75)
)
Arguments
disco |
Output of the DiSCo function. |
agg |
String indicating the aggregation statistic to be used. Options include
|
graph |
Boolean indicating whether to plot graphs (default is TRUE). |
t_plot |
Optional vector of time periods ( |
savePlots |
Boolean indicating whether to save the plots to the current working directory (default is FALSE). The plot names will be |
xlim |
Optional vector of length 2 indicating the x-axis limits of the plot. Useful for zooming in on relevant parts of the distribution for fat-tailed distributions. |
ylim |
Optional vector of length 2 indicating the y-axis limits of the plot. |
samples |
Numeric vector indicating the range of quantiles of the aggregation statistic ( |
Details
This function takes in the output of the DiSCo_per function and computes aggregate treatment effect using a user-specified aggregation statistic.
The default is the differences between the counterfactual and the observed quantile functions (quantileDiff
). If graph
is set to TRUE,
the function will plot the distribution of the aggregation statistic over time. The S3 class returned by the function
has a summary
property that will print a selection of aggregated effects (specified by the samples
parameter) for the chosen agg
method, by post-treatment year (see examples below).
This summary
call will only print effects if the agg
parameter requested a distribution difference (quantileDiff
or cdfDiff
). The other aggregations are meant to be inspected visually.
If the permutation
parameter was set to TRUE in the original DiSCo
call, the summary table will include the results of the permutation test.
If the original DiSCo
call was restricted to a range of quantiles smaller than [0,1]
(i.e. q_min
> 0 or q_max
< 1), the samples
parameter is ignored
and only the aggregated differences for the quantile range specified in the original call are returned.
Value
A DiSCoT
object, which is an S3 class that stores a list of treatment effects, their standard errors,
the corresponding confidence intervals (if specified), and a dataframe with treatment effects aggregated
according to the agg
input. The S3 class also has a summary
property that will print a selection of aggregated effects (specified by the samples
parameter)
for the chosen agg
method, by post-treatment year, as well as the permutation test results, if specified.