-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common Problems #12
Comments
Triple DifferencesThe following is the standard triple-difference estimator (e.g. Angrist and Pischke, 2008, p.181): where To implement this in first_stage = ~ 0 | region^time + group^time + group^region Then, for example, a |
Big Data / Matrix ProblemsThe main pain point in the code is calculating analytic standard errors. The formula for them requires me to store, in memory, the full (sparse) matrix including fixed effects. Two sources of problems:
In either case, if your code faults, you can add the function parameter library(did2s)
did2s(df_het,
yname = "dep_var", first_stage = ~ 0 | state + year,
second_stage = ~i(treat, ref=FALSE), treatment = "treat",
cluster_var = "state", bootstrap = T, n_boostraps = 250
)
#> Running Two-stage Difference-in-Differences
#> • first stage formula `~ 0 | state + year`
#> • second stage formula `~ i(treat, ref = FALSE)`
#> • The indicator variable that denotes when treatment is on is `treat`
#> • Standard errors will be block bootstrapped with cluster `state`
#> • Starting 250 bootstraps at cluster level: state
#> OLS estimation, Dep. Var.: dep_var
#> Observations: 46,500
#> Standard-errors: Custom
#> Estimate Std. Error t value Pr(>|t|)
#> treat::TRUE 2.15221 0.046291 46.4928 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 1.41487 Adj. R2: 0.337905 Created on 2022-05-20 by the reprex package (v2.0.1) |
A quick summary of problems I can link to people
The text was updated successfully, but these errors were encountered: