Skip to contents

Outputs a table of important synthetic controls and their corresponding weights, sorted by weight. The table is truncated to exclude synthetic controls that do not matter for any estimate — for each estimate, the truncated controls may have total weight no larger that 1-mass.

Usage

synthdid_controls(
  estimates,
  sort.by = 1,
  mass = SYNTHDID_CONTROLS_MASS_DEFAULT,
  weight.type = "omega"
)

Arguments

estimates,

a list of estimates output by synthdid_estimate. Or a single estimate.

sort.by,

the index of the estimate to sort by. Defaults to 1.

mass,

which controls the length of the table. Defaults to 0.9.

weight.type,

'omega' for units, 'lambda' for time periods

Value

A matrix of weights for the top controls/periods, sorted by importance.

Examples

# \donttest{
data(california_prop99)
setup <- panel.matrices(california_prop99)
tau.hat <- synthdid_estimate(setup$Y, setup$N0, setup$T0)

# Show top control units
synthdid_controls(tau.hat, weight.type = "omega")
#>                    Weight
#> Nevada         0.12448923
#> New Hampshire  0.10504758
#> Connecticut    0.07828729
#> Delaware       0.07036812
#> Colorado       0.05751279
#> Illinois       0.05338782
#> Nebraska       0.04785319
#> Montana        0.04513521
#> Utah           0.04151766
#> New Mexico     0.04056827
#> Minnesota      0.03949464
#> Wisconsin      0.03666708
#> West Virginia  0.03356911
#> North Carolina 0.03280518
#> Idaho          0.03146821
#> Ohio           0.03146077
#> Maine          0.02821102
#> Iowa           0.02593863

# Show top time periods
synthdid_controls(tau.hat, weight.type = "lambda")
#>         Weight
#> 1988 0.4271072
#> 1986 0.3663560
#> 1987 0.2064182

# Compare multiple estimates
tau.sc <- sc_estimate(setup$Y, setup$N0, setup$T0)
synthdid_controls(list(sdid = tau.hat, sc = tau.sc))
#>                      sdid         sc
#> Nevada         0.12448923 0.20442613
#> New Hampshire  0.10504758 0.04536371
#> Connecticut    0.07828729 0.10446734
#> Delaware       0.07036812 0.00405026
#> Colorado       0.05751279 0.01331585
#> Illinois       0.05338782 0.00000000
#> Nebraska       0.04785319 0.00000000
#> Montana        0.04513521 0.23227270
#> Utah           0.04151766 0.39610401
#> New Mexico     0.04056827 0.00000000
#> Minnesota      0.03949464 0.00000000
#> Wisconsin      0.03666708 0.00000000
#> West Virginia  0.03356911 0.00000000
#> North Carolina 0.03280518 0.00000000
#> Idaho          0.03146821 0.00000000
#> Ohio           0.03146077 0.00000000
#> Maine          0.02821102 0.00000000
#> Iowa           0.02593863 0.00000000
# }