DSC_main: Main Ouputs of DSC

Description Usage Arguments Value Examples

View source: R/DSC_main.R

Description

Function for computing pre-treatment weights, optimal weights, post-treatment barycenters, post-treatment confidence intervals.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
DSC_main(
  c_df,
  t_df,
  T0,
  M = 100,
  solver = "SCS",
  ww = 0,
  evgrid = seq(from = 0, to = 1, length.out = 101),
  cl = 0.99,
  num.redraws = 500
)

Arguments

c_df

a list of list: each sublist contains observations of every control units at a specific time period. e.g. c_df[[1]][[2]] contains the observations of the second control unit at the first time period.

t_df

a list of observations. e.g. t_df[[1]] contains the observations of the target at the first time period.

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 installed_solvers in CVXR for more options.

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.

evgrid

a vector of gridpoints used to evaluate quantile functions.

cl

a float specifying the confidence level.

num.redraws

an integer specifying the number of redraws used in the bootstrap approach.

Value

DSC_main returns a list containing the following components:

weight_t

a list of weights in each pre-treatment period.

weights

a vector of optimal weights.

bc_post

a list of post-treatment barycenters.

CI_post

a list of post-treatment confidence intervals.

Examples

1
2
3
4
#simulated data from independent normal distributions
#ex_normal() calls the simulated data
#detail can be found by ??ex_normal
DSC_main(c_df=ex_normal()$control, t_df=ex_normal()$target, T0=5, M=100, solver="SCS", ww="arithmetic", evgrid=seq(from=0, to=1, length.out=101), cl=0.99, num.redraws=500)

hesyserena/DSC documentation built on Dec. 20, 2021, 3:49 p.m.