The synthReturn
R package implements the synthetic matching method originally suggested by Acemoglu et al. (2016) and modified by Kreitmeir et al. (2023) to estimate the average treatment effect
For more details on the empirical framework, please see the Empirical Framework Section below.
If you end up using this package, please cite our paper:
- Kreitmeir, D., Lane, N., and Raschky, P. A. (2023). The value of names - Civil society, information, and governing multinationals. SSRN WP 3751162, https://ssrn.com/abstract=3751162
To install the most recent version of the synthReturn
package from GitHub:
# install.packages("devtools")
devtools::install_github("davidkreitmeir/synthReturn")
The following is an illustration of the method for a simulated dataset with (i) two event-dates and (ii) no missing values. For details on the generation of the simulated dataset(s), please see data-raw/sim_ret.R
.
Let's first get the data ready:
library(synthReturn)
# Load data in that comes in the synthReturn package
data(ret_two_evdates)
Now, to estimate the average treatment effect synthReturn
function:
results <- synthReturn(
data = ret_two_evdates,
tidname = "treatid",
cidname = "controlid",
rname = "ret",
dname = "date",
edname = "eventdate",
estwind = c(-100,-1),
eventwind = c(0,5),
estobs_min = 1,
eventobs_min = 1,
placebo = TRUE,
ngroup = 2,
ndraws = 10
)
results$ate
For the case that returns are missing for firms either in the treatment or control group, you can set a threshold for the minimum of non-missing trading days during both the estimation (estobs_min
) and event window (eventobs_min
). In this example, I require each firm to have non-missing returns for at least 90% of trading days during both, the estimation and event window (Note that the default is no missing returns, i.e. 100%).
# Load data in that comes in the synthReturn package
data(ret_two_evdates_na) # 5% of all returns missing
results <- synthReturn(
data = ret_two_evdates,
tidname = "treatid",
cidname = "controlid",
rname = "ret",
dname = "date",
edname = "eventdate",
estwind = c(-100,-1),
eventwind = c(0,5),
estobs_min = 0.9,
eventobs_min = 0.9,
placebo = TRUE,
ngroup = 2,
ndraws = 10
)
results$ate
A synthetic match for each company
where
The optimization problem above boils down to a quadratic programming problem, as the objective function is quadratic and the two constraints are linear. I.e. the problem can be written as:
where
Reformulating the optimization problem allows the use the dual method of Goldfarb and Idnani (1982, 1983) for solving quadratic programming problem implemented in quadprog::solve.QP
.
After finding the optimal weights
The cumulative abnormal return for the period
where
To draw inference, confidence intervals are constructed by randomly drawing placebo treatment groups, as suggested by Acemoglu et al. (2016). To accommodate multiple event dates synthRetrun
draws