Skip to contents

synthdid_estimate for diff-in-diff estimates. Takes all the same parameters, but by default, passes options to use the diff-in-diff estimator

Usage

did_estimate(Y, N0, T0, ...)

Arguments

Y

the observation matrix.

N0

the number of control units. Rows 1-N0 of Y correspond to the control units.

T0

the number of pre-treatment time steps. Columns 1-T0 of Y correspond to pre-treatment time steps.

...

additional options for synthdid_estimate

Value

an object like that returned by synthdid_estimate

Examples

# \donttest{
# Estimate treatment effect using difference-in-differences
data(california_prop99)
setup <- panel.matrices(california_prop99)

# DID estimate
tau.did <- did_estimate(setup$Y, setup$N0, setup$T0)
print(tau.did)
#> synthdid: -27.349 +- NA. Effective N0/N0 = 38.0/38~1.0. Effective T0/T0 = 19.0/19~1.0. N1,T1 = 1,12. [converged] 

# Compare all three estimators
tau.sc <- sc_estimate(setup$Y, setup$N0, setup$T0)
tau.sdid <- synthdid_estimate(setup$Y, setup$N0, setup$T0)
estimates <- list(did = tau.did, sc = tau.sc, sdid = tau.sdid)
sapply(estimates, function(x) x)
#>       did        sc      sdid 
#> -27.34911 -19.61966 -15.60379 

# Visualize the differences
# synthdid_plot(estimates)
# }