Description Usage Arguments Value Examples
Function for evaluating the significance of the estimates using permutation distributions
1 2 3 4 5 6 7 8 9 10 11 12 13 |
c_df |
a list of list: each sublist contains observations of every control units at a specific time period.
e.g. |
t_df |
a list of observations. e.g. |
T0 |
an integer specifying the end of pre-treatment period. |
M |
an integer specifying the number of draws from the uniform distribution for approximating the integral. |
solver |
a solver for the optimization problem; see |
ww |
0 or a vector. By default, i.e. 0, arithmetic mean is used for calculating optimal weights. Otherwise, a vector of specific weights is used. |
peridx |
0 or a vector. By default, i.e. 0, all control units will be used for the permutation. Otherwise, a vector of specific control units will be used. |
evgrid |
a vector of gridpoints used to evaluate quantile functions. |
graph |
|
y_name |
a string for the title of the y-axis. |
x_name |
a string for the title of the x-axis. |
DSC_per
returns a list containing the following components:
|
a vector of squared Wasserstein distances calculated using original target and control units. |
|
a list of squared Wasserstein distances calculated using permutation distributions. |
1 2 3 4 5 6 7 | #simulated data from independent normal distributions
#ex_normal() calls the simulated data
#detail can be found by ??ex_normal
#all control units are used
DSC_per(c_df=ex_normal()$control, t_df=ex_normal()$target, T0=5, M=100, solver="SCS", ww=0, peridx=0, evgrid=seq(from=0, to=1, length.out=1001), graph=TRUE, y_name='y', x_name='x')
#the first, third and fifth control units are used
DSC_per(c_df=ex_normal()$control, t_df=ex_normal()$target, T0=5, M=100, solver="SCS", ww=0, peridx=c(1,3,5), evgrid=seq(from=0, to=1, length.out=1001), graph=TRUE, y_name='y', x_name='x')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.