{"id":27403019,"url":"https://github.com/s3alfisc/fwildclusterboot","last_synced_at":"2025-04-14T04:47:12.091Z","repository":{"id":40200783,"uuid":"251085167","full_name":"s3alfisc/fwildclusterboot","owner":"s3alfisc","description":"Fast Wild Cluster Bootstrap Inference for Regression Models  / OLS in R. Additionally, R port to WildBootTests.jl via the JuliaConnectoR.","archived":false,"fork":false,"pushed_at":"2024-08-05T18:34:59.000Z","size":21869,"stargazers_count":25,"open_issues_count":30,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T15:08:40.956Z","etag":null,"topics":["clustered-standard-errors","linear-regression-models","wild-bootstrap","wild-cluster-bootstrap"],"latest_commit_sha":null,"homepage":"https://s3alfisc.github.io/fwildclusterboot/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s3alfisc.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2020-03-29T17:01:01.000Z","updated_at":"2025-02-20T01:41:39.000Z","dependencies_parsed_at":"2024-04-16T20:53:43.553Z","dependency_job_id":"1604785a-bcb6-4611-a302-ea01d2a07a35","html_url":"https://github.com/s3alfisc/fwildclusterboot","commit_stats":{"total_commits":1062,"total_committers":4,"mean_commits":265.5,"dds":0.004708097928436961,"last_synced_commit":"336bb574eba169ac0183317f01d0564791d8122f"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3alfisc%2Ffwildclusterboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3alfisc%2Ffwildclusterboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3alfisc%2Ffwildclusterboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3alfisc%2Ffwildclusterboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s3alfisc","download_url":"https://codeload.github.com/s3alfisc/fwildclusterboot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824672,"owners_count":21167343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustered-standard-errors","linear-regression-models","wild-bootstrap","wild-cluster-bootstrap"],"created_at":"2025-04-14T04:47:10.079Z","updated_at":"2025-04-14T04:47:12.074Z","avatar_url":"https://github.com/s3alfisc.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# fwildclusterboot \n\n\u003cimg src=\"man/figures/logo.png\" width=\"200px\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n\u003c!-- [![packageversion](https://img.shields.io/badge/Package%20version-`r version`-orange.svg?style=flat-square)](commits/master) --\u003e\n[![Status at rOpenSci Software Peer Review](https://badges.ropensci.org/546_status.svg)](https://github.com/ropensci/software-review/issues/546)\n[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![CRAN status](https://www.r-pkg.org/badges/version/fwildclusterboot)](https://CRAN.R-project.org/package=fwildclusterboot)\n![runiverse-package](https://s3alfisc.r-universe.dev/badges/fwildclusterboot)\n[![R-CMD-check](https://github.com/s3alfisc/fwildclusterboot/workflows/R-CMD-check/badge.svg)](https://github.com/s3alfisc/fwildclusterboot/actions)\n[![Codecov test coverage](https://codecov.io/gh/s3alfisc/fwildclusterboot/branch/master/graph/badge.svg)](https://app.codecov.io/gh/s3alfisc/fwildclusterboot?branch=master)\n`r badger::badge_cran_download(\"fwildclusterboot\", \"grand-total\", \"blue\")`\n`r badger::badge_cran_download(\"fwildclusterboot\", \"last-month\", \"green\")`\n\n\u003c!-- badges: end --\u003e\n\nThe `{fwildclusterboot}` package implements multiple fast wild cluster bootstrap algorithms as developed in [Roodman et al (2019)](https://econpapers.repec.org/paper/qedwpaper/1406.htm) and [MacKinnon, Nielsen \u0026 Webb (2022)](https://www.econ.queensu.ca/sites/econ.queensu.ca/files/wpaper/qed_wp_1485.pdf).\n\nVia the [JuliaConnectoR](https://CRAN.R-project.org/package=JuliaConnectoR), `{fwildclusterboot}` further ports functionality of [WildBootTests.jl](https://github.com/droodman/WildBootTests.jl) - which provides an even faster implementation of the wild cluster bootstrap for OLS and supports the WRE bootstrap for IV and tests of multiple joint hypotheses.\n\nThe package's central function is `boottest()`. It allows to test univariate hypotheses using a wild cluster bootstrap at extreme speed: via the 'fast' algorithm, it is possible to run a wild cluster bootstrap with $B = 100.000$ iterations in less than a second!\n\n```{r, fig.width=10, fig.height=3, echo = FALSE, warning = FALSE, message = FALSE}\nlibrary(ggplot2)\ndf \u003c- readRDS(\"C:/Users/alexa/Dropbox/R package development/fwildclusterboot develop/benchmarks/r_comparions.rds\")\n\ndf$B \u003c- factor(df$B, levels = c(\"10K\", \"100K\"))\ndf$N_G \u003c- factor(df$N_G, levels = c(\"N_G = 20\", \"N_G = 50\", \"N_G = 100\", \"N_G = 500\", \"N_G = 1000\"))\ndf$`boot algo` \u003c- df$type\n```\n\n```{r, fig.width=10, fig.height=3, echo = FALSE, warning = FALSE, message = FALSE}\nggplot(data = df, aes(x = B, y = time, color = `boot algo`)) + \n  facet_wrap(~N_G, nrow = 1) + \n  geom_point() + \nscale_y_continuous(trans='log10') + \n  labs(title = \"Benchmarks\", caption = \"N = 10_000, k = 20 covariates and one cluster of dimension N_G (3 iterations each, median runtime is plotted).\")+\n  #theme_bw() + \n  xlab(\"Bootstrap iterations\") + \n  ylab(\"time in seconds, log scale\") + \n  theme_bw()\n```\n\n\n`{fwildclusterboot}` supports the following features:\n\n+ The wild bootstrap for OLS (Wu 1986).\n+ The wild cluster bootstrap for OLS (Cameron, Gelbach \u0026 Miller 2008, Roodman et al, 2019).\n+ Multiple new versions of the wild cluster bootstrap as described in MacKinnon, Nielsen \u0026 Webb (2022), including the WCR13 (WCR-V), WCR31 (WCR-S), WCR33 (WCR-B), WCU13 (WCU-V), WCU31 (WCU-S) and WCU33 (WCU-B).\n+ The subcluster bootstrap (MacKinnon and Webb 2018).\n+ Confidence intervals formed by inverting the test and iteratively searching for bounds.\n+ Multiway clustering.\n+ One-way fixed effects.\n\nAdditional features are provided through `WildBootTests.jl`:\n\n+ Highly optimized versions of the '11' and '31' wild cluster bootstrap variants\n+ A highly optimized version of the Wild Restricted Efficient bootstrap (WRE) for IV/2SLS/LIML [(Davidson \u0026 MacKinnon, 2010)](https://www.tandfonline.com/doi/abs/10.1198/jbes.2009.07221).\n+ Arbitrary and multiple linear hypotheses in the parameters.\n\n`{fwildclusterboot}` supports the following models: \n\n+ OLS: `lm` (from stats), `fixest` (from fixest), `felm` from (lfe)\n+ IV: `ivreg` (from ivreg). \n\n### Installation\n\nYou can install compiled versions of`{fwildclusterboot}` from CRAN (compiled), R-universe (compiled) or github by following one of the steps below:\n\n```{r, eval = FALSE}\n# from CRAN \ninstall.packages(\"fwildclusterboot\")\n\n# from r-universe (windows \u0026 mac, compiled R \u003e 4.0 required)\ninstall.packages('fwildclusterboot', repos ='https://s3alfisc.r-universe.dev')\n# dev version from github\n# note: installation requires Rtools\nlibrary(devtools)\ninstall_github(\"s3alfisc/fwildclusterboot\")\n```\n\n### The `boottest()` function\n\nFor a longer introduction to `{fwildclusterboot}`, take a look at the [vignette](https://s3alfisc.github.io/fwildclusterboot/articles/fwildclusterboot.html).\n\n```{r, warning = FALSE, message = FALSE}\nlibrary(fwildclusterboot)\n\n# set seed via dqset.seed for engine = \"R\" \u0026 Rademacher, Webb \u0026 Normal weights\ndqrng::dqset.seed(2352342)\n# set 'familiar' seed for all other algorithms and weight types \nset.seed(23325)\n\ndata(voters)\n\n# fit the model via fixest::feols(), lfe::felm() or stats::lm()\nlm_fit \u003c- lm(proposition_vote ~ treatment  + log_income + as.factor(Q1_immigration) + as.factor(Q2_defense), data = voters)\n# bootstrap inference via boottest()\nlm_boot \u003c- boottest(lm_fit, clustid = c(\"group_id1\"), B = 9999, param = \"treatment\")\nsummary(lm_boot)\n```\n\n## Citation \n\nIf you are in `R`, you can simply run the following command to get the BibTeX citation for `{fwildclusterboot}`:\n\n```{r, warning = FALSE, message = FALSE}\ncitation(\"fwildclusterboot\")\n```\n\nAlternatively, if you prefer to cite the \"Fast \u0026 Wild\" paper by Roodman et al, it would be great if you mentioned `{fwildclusterboot}` in a footnote =) ! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3alfisc%2Ffwildclusterboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs3alfisc%2Ffwildclusterboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3alfisc%2Ffwildclusterboot/lists"}