Jose Andres Sumano

Graph 1


synthout <- base_para_synth %>% 
  synthetic_control(outcome = TasaHomicidios,
                    unit= Alcaldia,
                    time= Tiempo,
                    i_unit = "AlvaroObregon",
                    i_time = 20,
                    generate_placebos = T) %>%
  generate_predictor(time_window = 1:20, Gini =mean(Gini, na.rm=T)) %>%
  generate_predictor(time_window = 1:20, PoblacionenExtremaPobreza= mean(Poblacionenextremapobreza, na.rm=T))%>%
  generate_predictor(time_window = 1:20, Densidad= mean(Densidad, na.rm=T))%>%
  generate_predictor(time_window = 1:20, IDH =mean(IDH, na.rm=T))%>%
  generate_predictor(time_window = 1:20, Percepciondeinseguridad =mean(Percepciondeinseguridad, na.rm=T))%>%
  generate_predictor(time_window = 1:20, ConfianzaenPolicia =mean(ConfianzaenPolicia, na.rm=T))%>%
  generate_predictor(time_window = 1:20, Conflictos= mean(Conflictos, na.rm=T))%>%
  generate_predictor(time_window = 1:20, Disparos = mean(Disparos, na.rm=T))%>%
  generate_predictor(time_window = 1:20, Drogas =mean(Drogas, na.rm=T))%>%
  generate_weights(optimization_window = 1:20,
                   margin_ipop = .02, sigf_ipop = 7, bound_ipop = 6) %>%
  generate_control()
  synthout %>% plot_trends()+labs(title="Time Series of the synthetic and observed Homicide Rate", x="Time", y="Homicide Rate")

Graph 2


synthout %>% plot_differences()+labs(x="Time", y= "Homicide Rate")

Graph 3

Create the figure in the solution for Problem 2, using the data included in the R Markdown file.


synthout %>% plot_weights()

Graph 4


synthout %>% plot_placebos()+labs(x="Time", y="Homicide Rate")
       

Graph 5


synthout%>% plot_mspe_ratio()   

Graph 6


synthout %>% grab_significance()