devtools::install_github("synth-inference/synthdid")Comparison of the multisynthdid package with the classical synthdid package
Comparison with German Reunification Data
We will compare the effect of German Reunification on GDP with the classical synthdid package and our extended version for multiple outcomes.
First, install the original package.
Load the packages.
library(multisynthdid)
library(synthdid)
library(kableExtra)Get the imputed data for German reunification.
data("german_reunification")We estimate three models:
- Synthetic Diff-in-Diffs using
gdpas the outcome only - Multiple Synthetic Diff-in-Diff using
gdp,infrate(inflation) andtradeto get the weights - Multiple Synthetic Diff-in-Diff using
gdponly to get a comparison to the original package result.
# Original
setup_sdid = panel.matrices(as.data.frame( german_reunification ), unit = 'country', time = 'year', outcome = 'gdp', treatment = 'W')
sdid_tau = synthdid_estimate(setup_sdid$Y, setup_sdid$N0, setup_sdid$T0)
sdid_se = sqrt(vcov(sdid_tau, method='placebo'))
# Multi-outcome package estimated on GDP only -- should give the same result
multi_chk <- multi_sdid( gdp ~ 1, 'W', 'country', 'year', german_reunification )
# Multi estimated on multiple outcomes
multi <- multi_sdid( gdp + infrate + trade ~ 1, 'W', 'country', 'year', german_reunification )Summaries the results
| Original SDiD | Multi-outcome SDiD replicate | Multi-outcome SDiD | |
|---|---|---|---|
| Avg. Effect | -1471.39 | -1471.39 | -1526.46 |
| SE | 1362.44 | 1464.27 | 1348.76 |
Note that the SE-s are slightly different for Original and replicated as it uses randomization with 200 replication. In case one uses higher replication number for the placebo SEs, the values converge to each other.
Increase number of repetition for SEs
# Increase the replication with Original package
sdid_se_large = sqrt(vcov(sdid_tau, method='placebo', replications = 1000 ))
# With multiple outcome package
multi_chk_large <- multi_sdid( gdp ~ 1, 'W', 'country', 'year', german_reunification, SE = T, se_replication = 1000 )With 1000 replication we got a closer estimates to each other:
| Original SDiD | Multi-SDiD | Abs. Diff | |
|---|---|---|---|
| 200 | 1362.44 | 1464.27 | 101.83 |
| 1000 | 1522.04 | 1477.02 | 45.03 |