::install_github("synth-inference/synthdid") devtools
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
gdp
as the outcome only - Multiple Synthetic Diff-in-Diff using
gdp
,infrate
(inflation) andtrade
to get the weights - Multiple Synthetic Diff-in-Diff using
gdp
only to get a comparison to the original package result.
# Original
= panel.matrices(as.data.frame( german_reunification ), unit = 'country', time = 'year', outcome = 'gdp', treatment = 'W')
setup_sdid = synthdid_estimate(setup_sdid$Y, setup_sdid$N0, setup_sdid$T0)
sdid_tau = sqrt(vcov(sdid_tau, method='placebo'))
sdid_se
# Multi-outcome package estimated on GDP only -- should give the same result
<- multi_sdid( gdp ~ 1, 'W', 'country', 'year', german_reunification )
multi_chk
# Multi estimated on multiple outcomes
<- multi_sdid( gdp + infrate + trade ~ 1, 'W', 'country', 'year', german_reunification ) multi
Summaries the results
Original SDiD | Multi-outcome SDiD replicate | Multi-outcome SDiD | |
---|---|---|---|
Avg. Effect | -1471.39 | -1471.39 | -1526.46 |
SE | 1434.65 | 1552.74 | 1474.69 |
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
= sqrt(vcov(sdid_tau, method='placebo', replications = 1000 ))
sdid_se_large
# With multiple outcome package
<- multi_sdid( gdp ~ 1, 'W', 'country', 'year', german_reunification, SE = T, se_replication = 1000 ) multi_chk_large
With 1000 replication we got a closer estimates to each other:
Original SDiD | Multi-SDiD | Abs. Diff | |
---|---|---|---|
200 | 1434.65 | 1552.74 | 118.09 |
1000 | 1522.92 | 1466.60 | 56.32 |