DiSCo_per | R Documentation |
Function to implement permutation test for Distributional Synthetic Controls
DiSCo_per(
results.periods,
T0,
ww = 0,
peridx = 0,
evgrid = seq(from = 0, to = 1, length.out = 101),
graph = TRUE,
num.cores = 1,
weights = NULL,
qmethod = NULL,
qtype = qtype,
q_min = 0,
q_max = 1,
M = 1000,
simplex = FALSE,
mixture = FALSE
)
results.periods |
List of period-specific results from DiSCo |
T0 |
Integer indicating first year of treatment as counted from 1 (e.g, if treatment year 2002 was the 5th year in the sample, this parameter should be 5). |
ww |
Optional vector of weights indicating the relative importance of each time period. If not specified, each time period is weighted equally. |
peridx |
Optional integer indicating number of permutations. If not specified, by default equal to the number of units in the sample. |
graph |
Logical, indicating whether to plot the permutation graph as in Figure 3 of the paper. Default is FALSE. |
num.cores |
Integer, number of cores to use for parallel computation. Default is 1. If the |
weights |
Optional vector of weights to use for the "true" treated unit. |
qmethod |
Character, indicating the method to use for computing the quantiles of the target distribution. The default is NULL, which uses the |
qtype |
Integer, indicating the type of quantile to compute when using |
q_min |
Numeric, minimum quantile to use. Set this together with |
q_max |
Numeric, maximum quantile to use. Set this together with |
M |
Integer indicating the number of control quantiles to use in the DiSCo method. Default is 1000. |
simplex |
Logical, indicating whether to use to constrain the optimal weights to the unit simplex. Default is FALSE, which only constrains the weights to sum up to 1 but allows them to be negative. |
mixture |
Logical, indicating whether to use the mixture of distributions approach instead.
See Section 4.3. in \insertCitegunsilius2023distributional;textualDiSCos. This approach minimizes the distance between the CDFs
instead of the quantile functions, and is preferred for categorical variables. When working with such variables, one should
also provide a list of support points in the |
This program iterates through all units and computes the optimal weights on the other units for replicating the unit of iteration's outcome variable, assuming that it is the treated unit. See Algorithm 1 in \insertCitegunsilius2023distributional;textualDiSCos for more details. The only modification is that we take the ratio of post- and pre-treatment root mean squared Wasserstein distances to calculate the p-value, rather than the level in each period, following @abadie2010synthetic.
List of matrices containing synthetic time path of the outcome variable for the target unit together with the time paths of the control units
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.