asheshrambachan / HonestDiD

Robust inference in difference-in-differences and event study designs
Other
175 stars 45 forks source link

Pull Request follow-up for #30: Example and Vignette runtime #56

Closed mcaceresb closed 6 months ago

mcaceresb commented 6 months ago

This addresses the comments here that the computing time for the examples, tests, and vignette are too long.

mcaceresb commented 6 months ago

@jonathandroth Can you test the function on your mac? The tests are failing for OSX but not for Linux somehow. Just wanna double-check there isn't an issue. LMK and I'll merge.

jonathandroth commented 6 months ago

I ran test_base.R (I assume that's what you wanted?) and I get the following error:

── Error (~/Library/CloudStorage/Dropbox/HonestDiD_MauricioGithub/HonestDiD/tests/test_base.R:28:5): HonestDiD base ran with no errors ── Error in { temp = computeConditionalCS_DeltaSD(betahat = betahat, sigma = sigma, numPrePeriods = numPrePeriods, numPostPeriods = numPostPeriods, l_vec = l_vec, alpha = alpha, M = Mvec[m], hybrid_flag = "ARP") tibble::tibble(lb = base::min(temp$grid[temp$accept == 1]), ub = base::max(temp$grid[temp$accept == 1]), method = "Conditional", Delta = "DeltaSD", M = Mvec[m]) }: task 2 failed - "ℹ In index: 763. Caused by error in if (sigma_B_dual < 10^(-10)) ...: ! missing value where TRUE/FALSE needed" Backtrace: ▆

  1. └─HonestDiD::createSensitivityResults(...) at HonestDiD/tests/test_base.R:28:4
  2. └─... %do% ... at HonestDiD/R/sensitivityresults.R:62:8
  3. └─e$fun(obj, substitute(ex), parent.frame(), e$data)

Error in reporter$stop_if_needed() : Test failed

mcaceresb commented 6 months ago

@jonathandroth Ok this is fixed. It seems sometimes it overflowed into a numerical zero but it was negative, so sqrt failed. I've accounted for this. I'll merge.