insongkim / PanelMatch

113 stars 34 forks source link

PanelEstimate error in latest package #66

Closed marcgrinberg closed 2 years ago

marcgrinberg commented 4 years ago

I'm running PanelMatch for the first time since February. I updated to the latest package.

I got an error when I tried to specify inference = "bootstrap" for standard error calculations in PanelEstimate(). So I removed it. But now I'm getting a new error and warning message

Error in PanelEstimate(sets = PM_reweight, data = as.data.frame(data2)) :
WFE cannot be used unless treatment stability is guaranteed. Please re-run PanelMatch with forbid.treatment.reversal = TRUE In addition: Warning message: In if (!attr(sets, "forbid.treatment.reversal") & inference == "wfe") { : the condition has length > 1 and only the first element will be used

Does it now default to WFE for standard errors? How do I use bootstrap again?

Thanks, Marc

adamrauh commented 4 years ago

Hi Marc, Thanks for continuing to use the package! How did you install the latest version? Was it with install_github("insongkim/PanelMatch", dependencies=TRUE)? I just looked at the code in master and I don't see that error message anywhere, so I think there was some issue with updating.

-Adam

marcgrinberg commented 4 years ago

Thanks. I think I installed from CRAN. Re-installed from github and I no longer get that error.

But I am getting a lot of not linearly-independent errors. The old version had an option to download a "problematic_matrix.rda" file. I always found that helpful for figuring out what was going on. I see it was commented out in the new version (https://rdrr.io/cran/PanelMatch/src/R/pm_helpers_r.R). Why get rid of it?

adamrauh commented 4 years ago

Unfortunately, we had to take that out to meet the CRAN guidelines. We can't write anything to disk. I'm happy to comment that back in in another branch if that would help, though. We might be able to come up with a way to have similar functionality in a future version...If you have any ideas on how to make that more useful, let us know.

marcgrinberg commented 4 years ago

Got it.

The most common problem I run into when running PanelMatch is that I have linearly-dependent variables in my CBPS formula. I may be missing something obvious (I learned linear algebra a long time ago) but with data that has lots of observations and a CBPS formula with lots of variables, it can be really hard to figure out where the problem is manually. I discovered that I could run the problematic_matrix.rda file through the findLinearCombos() function in the caret package and this pointed me to where the problems were. Would be really helpful to get some sort of functionality like that back.

Thanks!