Comments (6)
from honestdid.
Thanks for your prompt response, I re-run the codes with fixed grid but the problem persists. Here is my code:
honest.twfe <- createSensitivityResults_relativeMagnitudes(betahat = beta.twfe,
sigma = vcov.twfe,
numPrePeriods = 12,
numPostPeriods = 1,
l_vec = c(1),
Mbarvec = c(0,0.25,0.5,0.75,1),
grid.ub = 0.8,
grid.lb = -0.8)
lb ub method Delta Mbar
<dbl> <dbl> <chr> <chr> <dbl>
1 0.0553 0.175 C-LF DeltaRM 0
2 0.0569 0.174 C-LF DeltaRM 0.25
3 0.0521 0.177 C-LF DeltaRM 0.5
4 0.0360 0.191 C-LF DeltaRM 0.75
5 0.0200 0.209 C-LF DeltaRM 1
Let me know if you need the data to replicate this issue. And I am still confused about the difference between the confidence interval when Mbar equals to zero and the confidence interval given by constructOriginalCS(). They should be similar right? But in my case they are not.
from honestdid.
from honestdid.
Thanks for the quick reply, this is the link to the data.
https://drive.google.com/file/d/14IoDrnCulGmUfCyBJkqmNp-iObSIgw_3/view?usp=sharing
Here is the code for the event study.
`rm(list = ls())
library(HonestDiD)
library(fixest)
load("example.RData")
twfe.est <- feols(general_sharetotal_A_all ~ i(Time_to_Treatment, treat, ref = -1) + cand_H_all + cand_B_all| district_final + cycle,
data = data.twfe, cluster = "district_final")
beta.twfe <- twfe.est$coeftable[c(4:16),1]
vcov.twfe <- summary(twfe.est)$cov.scaled[c(4:16),c(4:16)]
honest.twfe <- createSensitivityResults_relativeMagnitudes(betahat = beta.twfe,
sigma = vcov.twfe,
numPrePeriods = 12,
numPostPeriods = 1,
l_vec = c(1),
Mbarvec = c(0,0.25,0.5,0.75,1),
grid.ub = 0.8,
grid.lb = -0.8)
honest.twfe
original.twfe <- constructOriginalCS(betahat = beta.twfe,
sigma = vcov.twfe,
numPrePeriods = 12,
numPostPeriods = 1,
l_vec = c(1))
original.twfe`
from honestdid.
Hmm, that is weird. I am able to replicate your strange result. However, if I include the second post-treatment coefficient and then tell it I'm only interested in the first one (l_vec = c(1,0)
), then I get the expected result that the CI for M=0 is nearly identical to the original CI, and the CIs expand as M increases.
library(fixest)
load("~/Downloads/example.RData")
twfe.est <- feols(general_sharetotal_A_all ~ i(Time_to_Treatment, treat, ref = -1) + cand_H_all + cand_B_all| district_final + cycle,
data = data.twfe, cluster = "district_final")
beta.twfe <- twfe.est$coeftable[c(4:17),1]
vcov.twfe <- summary(twfe.est)$cov.scaled[c(4:17),c(4:17)]
honest.twfe <- createSensitivityResults_relativeMagnitudes(betahat = beta.twfe,
sigma = vcov.twfe,
numPrePeriods = 12,
numPostPeriods = 2,
l_vec = c(1,0),
Mbarvec = c(0,0.25,0.5,0.75,1),
grid.ub = 0.8,
grid.lb = -0.8)
IIRC, HonestDiD has a special subroutine for the case without nuisance parameters (i.e. only one post-treatment period), and I'm wondering if there is a bug there. @mcaceresb when you have some RA time, could you look into this please?
CCing @asheshrambachan since I think you wrote this code initially and may have a better idea where the bug is.
from honestdid.
@jonathandroth The critical values are different.
-
The least-favorable critical value is larger here when using the "no-nuisance" parameter logic.
- This call does not pass
X_T
orrowsForARP
, contrast with this call. - As a result, they use different parts of this if-else block and give different critical values.
- The no-nuisance logic and the nuisance logic have the same lhs but different rhs as a result.
- This call does not pass
-
If the least-favorable CV is not rejected, the next critical value is obtained from the generalized normal, which is also different.
- This no-nuisance call uses the values returned from
.VLoVUpFN
for the lower and upper bounds, whereas this nuisance call uses the values from.lp_dual_fn
; I'm not quite sure why but they end up being rather different, but they do.
- This no-nuisance call uses the values returned from
from honestdid.
Related Issues (20)
- A problem when i run command HonestDiD::createSensitivityResults_relativeMagnitudes HOT 3
- Query about CIs under different values of Mbar HOT 3
- HonestDiD::createSensitivityPlot_relativeMagnitudes and unused filter HOT 4
- Package dependencies and package conflicts HOT 2
- Add explicit calls to buit-in functions
- Apply honestdid on did2s results HOT 9
- Options in `honest_did.AGGTEobj` HOT 1
- Dependencies HOT 11
- Example using the DRDID package? HOT 3
- constructOriginalCS does not give original confidence intervals + guidance on event studies with controls HOT 3
- Handling of universal base period HOT 4
- Warning for sigma that is not positive semi-definite HOT 4
- Robust CIs narrower than original CIs with large number of pre-treatment periods HOT 2
- Honest_did function not working HOT 2
- Warning in install.packages: package ‘HonestDiD’ is not available for this version of R HOT 3
- Graphing for estimator from Callaway and Sant’Anna (2020) HOT 2
- Error when running sensitivity analysis with honest did HOT 11
- Error when running createSensitivityResults_relativeMagnitudes - Caused by error in `svd()`: ! a dimension is zero" HOT 12
- Hitting the upper bound? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from honestdid.