Skip to contents
library(Ssynthdid)

Data

cal <- california()
head(cal)
#> # A tibble: 6 × 4
#>   State        Year PacksPerCapita treated
#>   <chr>       <dbl>          <dbl>   <dbl>
#> 1 Alabama      1970           89.8       0
#> 2 Arkansas     1970          100.        0
#> 3 Colorado     1970          125.        0
#> 4 Connecticut  1970          120         0
#> 5 Delaware     1970          155         0
#> 6 Georgia      1970          110.        0

Estimation

est_cal <- ssynth_estimate(cal, unit = "State", time = "Year", treated = "treated", outcome = "PacksPerCapita")

ATT estimate

est_cal$att_estimate
#> [1] -15.60383

Info panel_matrices -> original package result

est_cal$att_table
#> # A tibble: 1 × 11
#>    time   tau tau_wt weighted_tau    N0    T0    N1    T1 weights_sdid Y_beta  
#>   <dbl> <dbl>  <dbl>        <dbl> <int> <dbl> <int> <dbl> <list>       <list>  
#> 1  1989 -15.6     12        -15.6    38    19     1    12 <named list> <dbl[…]>
#> # ℹ 1 more variable: Units <list>
  • time: adoption time
  • tau: att for adoption time
  • ..
  • N0: the number of control units
  • T0: Number of time periods before treatment
  • weights_sdid: weights estimate
  • Y_beta: data pivoted for this time
  • Units: Vector of units (rownames Y_beta)