Simulates data from DGPs used in the placebo studies in Sections 3 and 5 of the synthetic difference in differences paper. Described there in Section 3.1.1.
Source:R/placebo-simulations.R
simulate_dgp.RdSimulates data from DGPs used in the placebo studies in Sections 3 and 5 of the synthetic difference in differences paper. Described there in Section 3.1.1.
Value
a list with 3 elements: the outcome matrix Y, the number of control units N0, and the number of control periods T0. The first N0 rows of Y are for units assigned to control, the remaining rows are for units assigned to treatment.
Examples
# \donttest{
# Estimate DGP from real data
data(california_prop99)
setup <- panel.matrices(california_prop99)
dgp_params <- estimate_dgp(setup$Y, setup$Y[, ncol(setup$Y)] > 0, rank = 2)
# Simulate new data from estimated DGP
sim_data <- simulate_dgp(dgp_params, N1 = 5, T1 = 10)
# Estimate treatment effect on simulated data
tau.sim <- synthdid_estimate(sim_data$Y, sim_data$N0, sim_data$T0)
print(tau.sim)
#> synthdid: 0.067 +- 0.189. Effective N0/N0 = 24.8/34~0.7. Effective T0/T0 = 1.3/21~0.1. N1,T1 = 5,10. [NOT CONVERGED]
# }