s3alfisc / fwildclusterboot

Fast Wild Cluster Bootstrap Inference for Regression Models / OLS in R. Additionally, R port to WildBootTests.jl via the JuliaConnectoR.
https://s3alfisc.github.io/fwildclusterboot/
GNU General Public License v3.0
23 stars 4 forks source link

Argument 'data' could not be evaluated. Problem: object 'data_2' not found. #79

Closed giannilmbd closed 1 year ago

giannilmbd commented 1 year ago

Hi, Thanks for making your code available. I've run the following fit.pst3<-fixest::feols(data =data_2,fml= formula(paste(update(form,.~.-factor(cc)),"|cc",sep='')),panel.id =c("cc","year")) summary(fit.pst3) fixest::etable(fit.pst3) boot_feols <- fwildclusterboot::boottest(fit.pst3, clustid = "cc", param = "M3_ratedif", B = 9999) and got the error ' Argument 'data' could not be evaluated. Problem: object 'data_2' not found.' data_2 is a data.frame object that is accepted with no issues by feols. Note that I'm calling your function from within another function. Thanks

Gianni

s3alfisc commented 1 year ago

Hi Gianni, thanks for reporting! Which version are you running? This almost certainly is an environment error - basically fwildclusterboot does not find the data because it searches in the wrong env. I have updated this a while back and thought / hoped such errors would no longer occur. If you are not running the most up to date version, could you please reinstall fwildclusterboot and report if the error vanishes? If not, I will start investigating :) As the package is currently not on CRAN (a long story), you can download from r universe (via install.packages('fwildclusterboot', repos ='https://s3alfisc.r-universe.dev')). Best, Alex

s3alfisc commented 1 year ago

Here is a related issue - the discussed error was fixed with version 0.9 =)

giannilmbd commented 1 year ago

Thanks Alex. I've actually installed it today from GitHub (devtools::install_github("s3alfisc/fwildclusterboot")). Should I install it from r-universe instead?. Cheers Gianni

On Sat, Nov 19, 2022 at 3:18 PM Alexander Fischer @.***> wrote:

Hi Gianni, thanks for reporting! Which version are you running? This almost certainly is an environment error - basically fwildclusterboot does not find the data because it searches in the wrong env. I have updated this a while back and thought / hoped such errors would no longer occur. If you are not running the most up to date version, could you please reinstall fwildclusterboot and report if the error vanishes? If not, I will start investigating :) As the package is currently not on CRAN (a long story), you can download from r universe (via install.packages('fwildclusterboot', repos ='https://s3alfisc.r-universe.dev')). Best, Alex

— Reply to this email directly, view it on GitHub https://github.com/s3alfisc/fwildclusterboot/issues/79#issuecomment-1320895382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLXB3YLT3ZOKJEA5WQ7P53WJDOTHANCNFSM6AAAAAASFJQC6M . You are receiving this because you authored the thread.Message ID: @.***>

s3alfisc commented 1 year ago

Both should lead to the same outcome =) the advantage of r-universe is that the c++ code is already compiled. Did updating the package fix the error?

giannilmbd commented 1 year ago

No luck. I've re-installed from r-universe but got the same error. Indeed it seems it's looking for the data in the main environment, but the data is available only within the function.

On Sat, Nov 19, 2022 at 6:06 PM Alexander Fischer @.***> wrote:

Both should lead to the same outcome =) the advantage of r-universe is that the c++ code is already compiled. Did updating the package fix the error?

— Reply to this email directly, view it on GitHub https://github.com/s3alfisc/fwildclusterboot/issues/79#issuecomment-1320925902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLXB36NQ2ZMVTIHBDP5YM3WJECH5ANCNFSM6AAAAAASFJQC6M . You are receiving this because you authored the thread.Message ID: @.***>

s3alfisc commented 1 year ago

Thanks for reporting. Just as a side comment before I dive into this deeper - it looks like you might be looping over "feols()" for multiple specifications? Have you tried to use fixest's multiple estimation functionality? That should be well supported by fwildclusterboot, see the news log for version 0.9 (I should probably add this to the main vignette). Beyond, I hope I'll find time to take a closer look at this tomorrow =)

giannilmbd commented 1 year ago

Great, thanks! I’ll give a try to the multiple specifications.

On Sat, 19 Nov 2022 at 19:39, Alexander Fischer @.***> wrote:

Thanks for reporting. Just as a side comment before I dive into this deeper - it looks like you might be looping over "feols()" for multiple specifications? Have you tried to use fixest's multiple estimation functionality? That should be well supported by fwildclusterboot, see the news log for version 0.9 (I should probably add this to the main vignette). Beyond, I hope I'll find time to take a closer look at this tomorrow =)

— Reply to this email directly, view it on GitHub https://github.com/s3alfisc/fwildclusterboot/issues/79#issuecomment-1320943446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLXB322JTTLERJSUH6SAKLWJENHFANCNFSM6AAAAAASFJQC6M . You are receiving this because you authored the thread.Message ID: @.***>

-- Giovanni Lombardo Bank for International Settlements Basel - CH www.giovannilombardo.ch @.***

s3alfisc commented 1 year ago

Hi @giannilmbd, have you managed to work around the problem above?

giannilmbd commented 1 year ago

Hi, No, not yet Cheers Gianni

On Thu, Nov 24, 2022 at 5:39 PM Alexander Fischer @.***> wrote:

Hi @giannilmbd https://github.com/giannilmbd, have you managed to work around the problem above?

— Reply to this email directly, view it on GitHub https://github.com/s3alfisc/fwildclusterboot/issues/79#issuecomment-1326667785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLXB3YBMR44OBMWMKXMZLDWJ6K23ANCNFSM6AAAAAASFJQC6M . You are receiving this because you were mentioned.Message ID: @.***>

s3alfisc commented 1 year ago

Hi @giannilmbd , is this still relevant? If not, I'd like to close the issue :) Best, Alex

giannilmbd commented 1 year ago

Thanks Alex, Not relevant right now. I think you can close the issue. Thanks for asking Gianni

On Fri, 30 Dec 2022 at 15:55, Alexander Fischer @.***> wrote:

Hi @giannilmbd https://github.com/giannilmbd , is this still relevant? If not, I'd like to close the issue :) Best, Alex

— Reply to this email directly, view it on GitHub https://github.com/s3alfisc/fwildclusterboot/issues/79#issuecomment-1367958008, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLXB32OJX2FTV63NRWY6TLWP3ZX5ANCNFSM6AAAAAASFJQC6M . You are receiving this because you were mentioned.Message ID: @.***>

-- Giovanni Lombardo Bank for International Settlements Basel - CH www.giovannilombardo.ch @.***