- Notifications
You must be signed in to change notification settings - Fork3
Fast Wild Cluster Bootstrap Inference for Regression Models / OLS in R. Additionally, R port to WildBootTests.jl via the JuliaConnectoR.
License
s3alfisc/fwildclusterboot
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The{fwildclusterboot} package implements multiple fast wild clusterbootstrap algorithms as developed inRoodman et al(2019) andMacKinnon, Nielsen & Webb(2022).
Via theJuliaConnectoR,{fwildclusterboot} further ports functionality ofWildBootTests.jl - whichprovides an even faster implementation of the wild cluster bootstrap forOLS and supports the WRE bootstrap for IV and tests of multiple jointhypotheses.
The package’s central function isboottest(). It allows to testunivariate hypotheses using a wild cluster bootstrap at extreme speed:via the ‘fast’ algorithm, it is possible to run a wild cluster bootstrapwith
{fwildclusterboot} supports the following features:
- The wild bootstrap for OLS (Wu 1986).
- The wild cluster bootstrap for OLS (Cameron, Gelbach & Miller 2008,Roodman et al, 2019).
- Multiple new versions of the wild cluster bootstrap as described inMacKinnon, Nielsen & Webb (2022), including the WCR13 (WCR-V), WCR31(WCR-S), WCR33 (WCR-B), WCU13 (WCU-V), WCU31 (WCU-S) and WCU33(WCU-B).
- The subcluster bootstrap (MacKinnon and Webb 2018).
- Confidence intervals formed by inverting the test and iterativelysearching for bounds.
- Multiway clustering.
- One-way fixed effects.
Additional features are provided throughWildBootTests.jl:
- Highly optimized versions of the ‘11’ and ‘31’ wild clusterbootstrap variants
- A highly optimized version of the Wild Restricted Efficientbootstrap (WRE) for IV/2SLS/LIML(Davidson & MacKinnon,2010).
- Arbitrary and multiple linear hypotheses in the parameters.
{fwildclusterboot} supports the following models:
- OLS:
lm(from stats),fixest(from fixest),felmfrom (lfe) - IV:
ivreg(from ivreg).
You can install compiled versions of{fwildclusterboot} from CRAN(compiled), R-universe (compiled) or github by following one of thesteps below:
# from CRANinstall.packages("fwildclusterboot")# from r-universe (windows & mac, compiled R > 4.0 required)install.packages('fwildclusterboot',repos='https://s3alfisc.r-universe.dev')# dev version from github# note: installation requires Rtoolslibrary(devtools)install_github("s3alfisc/fwildclusterboot")
For a longer introduction to{fwildclusterboot}, take a look at thevignette.
library(fwildclusterboot)# set seed via dqset.seed for engine = "R" & Rademacher, Webb & Normal weightsdqrng::dqset.seed(2352342)# set 'familiar' seed for all other algorithms and weight typesset.seed(23325)data(voters)# fit the model via fixest::feols(), lfe::felm() or stats::lm()lm_fit<- lm(proposition_vote~treatment+log_income+ as.factor(Q1_immigration)+ as.factor(Q2_defense),data=voters)# bootstrap inference via boottest()lm_boot<- boottest(lm_fit,clustid= c("group_id1"),B=9999,param="treatment")summary(lm_boot)#> boottest.lm(object = lm_fit, param = "treatment", B = 9999, clustid = c("group_id1"))#>#> Hypothesis: 1*treatment = 0#> Observations: 300#> Bootstr. Type: rademacher#> Clustering: 1-way#> Confidence Sets: 95%#> Number of Clusters: 40#>#> term estimate statistic p.value conf.low conf.high#> 1 1*treatment = 0 0.079 3.983 0.001 0.039 0.119
If you are inR, you can simply run the following command to get theBibTeX citation for{fwildclusterboot}:
citation("fwildclusterboot")#>#> To cite 'fwildclusterboot' in publications use:#>#> Fischer & Roodman. (2021). fwildclusterboot: Fast Wild Cluster#> Bootstrap Inference for Linear Regression Models. Available from#> https://cran.r-project.org/package=fwildclusterboot.#>#> A BibTeX entry for LaTeX users is#>#> @Misc{,#> title = {fwildclusterboot: Fast Wild Cluster Bootstrap Inference for Linear Regression Models (Version 0.14.0)},#> author = {Alexander Fischer and David Roodman},#> year = {2021},#> url = {https://cran.r-project.org/package=fwildclusterboot},#> }
Alternatively, if you prefer to cite the “Fast & Wild” paper by Roodmanet al, it would be great if you mentioned{fwildclusterboot} in afootnote =) !
About
Fast Wild Cluster Bootstrap Inference for Regression Models / OLS in R. Additionally, R port to WildBootTests.jl via the JuliaConnectoR.
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.

