This function plots the trajectories of the outcome variable for the treated unit and the synthetic control group constructed by synth
and dataprep
. The user can specify whether the whole
time period or only the pretreatment period should be plotted.
path.plot(synth.res = NA,
dataprep.res = NA,
tr.intake = NA,
Ylab = c("Y Axis"),
Xlab = c("Time"),
Ylim = NA,
Legend=c("Treated","Synthetic"),
Legend.position=c("topright"),
Main = NA,
Z.plot = FALSE)
The plot of trajectories.
Output list created by synth
.
Output list created by dataprep
.
Optional scalar to indicate the time of treatment intake with a vertical line.
Optional label for Y axis.
Optional label for X axis.
Optional Ylim.
Optional main title.
Optional legend text (e.g. c("Treated","Synthetic")); see ?legend for details.
Optional legend position (e.g. "bottomright"); see ?legend for details.
Flag. If true, only pretreatment period is plotted.
Jens Hainmueller and Alexis Diamond
The trajectory of the outcome for the synthetic control group is calculated as: dataprep.res$Y0plot%*% synth.res$solution.w. You can use this calculation to construct custom made plots.
Abadie, A., Diamond, A., Hainmueller, J. (2014). Comparative Politics and the Synthetic Control Method. American Journal of Political Science Forthcoming 2014.
Synthetic : An R Package for Synthetic Control Methods in Comparative Case Studies. Journal of Statistical Software 42 (13) 1--17.
Abadie, A., Diamond, A., Hainmueller, J. (2011). Synth: An R Package for Synthetic Control Methods in Comparative Case Studies. Journal of Statistical Software 42 (13) 1--17.
Abadie A, Diamond A, Hainmueller J (2010). Synthetic Control Methods for Comparative Case Studies: Estimating the Effect of California's Tobacco Control Program. Journal of the American Statistical Association 105 (490) 493--505.
Abadie, A. and Gardeazabal, J. (2003) Economic Costs of Conflict: A Case Study of the Basque Country American Economic Review 93 (1) 113--132.
dataprep
, gaps.plot
, synth
, synth.tab