Skip to contents

Extract fitted values from synthdid object

Usage

# S3 method for class 'synthdid'
fitted(object, ...)

Arguments

object

A synthdid object

...

Additional arguments (currently ignored)

Value

A matrix of fitted values for the control units

Examples

# \donttest{
data(california_prop99)
result <- synthdid(PacksPerCapita ~ treated,
  data = california_prop99,
  index = c("State", "Year")
)
fitted_vals <- fitted(result)
head(fitted_vals)
#>       [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10] [,11] [,12]
#> [1,]  89.8  95.4 101.1 102.9 108.2 111.7 116.2 117.1 123.0 121.4 123.2 119.6
#> [2,] 100.3 104.1 103.9 108.0 109.7 114.8 119.1 122.6 127.3 126.5 131.8 128.7
#> [3,] 124.8 125.5 134.3 137.9 132.8 131.0 134.2 132.0 129.2 131.5 131.0 133.8
#> [4,] 120.0 117.6 110.8 109.3 112.4 110.2 113.4 117.3 117.5 117.4 118.0 116.4
#> [5,] 155.0 161.1 156.3 154.7 151.3 147.6 153.0 153.3 155.5 150.2 150.5 152.6
#> [6,] 109.9 115.7 117.0 119.8 123.7 122.9 125.9 127.9 130.6 131.0 134.0 131.7
#>      [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
#> [1,] 119.1 116.3 113.0 114.5 116.3 114.0 112.1 105.6 108.6 107.9 109.1 108.5
#> [2,] 127.4 128.0 123.1 125.8 126.0 122.3 121.5 118.3 113.1 116.8 126.0 113.8
#> [3,] 130.5 125.3 119.7 112.4 109.9 102.4  94.6  88.8  87.4  90.2  88.3  88.6
#> [4,] 114.7 114.1 112.5 111.0 108.5 109.0 104.8 100.6  91.5  86.7  83.5  79.1
#> [5,] 154.1 149.6 144.0 144.5 142.4 141.0 137.1 131.7 127.2 118.8 120.0 123.8
#> [6,] 131.2 128.6 126.3 128.8 129.0 129.3 124.1 117.1 113.8 109.6 109.2 109.2
#>      [,25] [,26] [,27] [,28] [,29] [,30] [,31]
#> [1,] 107.1 102.6 101.4 104.9 106.2 100.7  96.2
#> [2,] 108.8 113.0 110.7 108.7 109.5 104.8  99.4
#> [3,]  89.1  85.4  83.1  81.3  81.2  79.6  73.0
#> [4,]  76.6  79.3  76.0  75.9  75.5  73.4  71.4
#> [5,] 126.1 127.2 128.3 124.1 132.8 139.5 140.7
#> [6,] 107.8 100.3 102.7 100.6 100.5  97.1  88.4
# }