Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fast Wild Cluster Bootstrap Inference for Regression Models / OLS in R. Additionally, R port to WildBootTests.jl via the JuliaConnectoR.

License

NotificationsYou must be signed in to change notification settings

s3alfisc/fwildclusterboot

Repository files navigation

Status at rOpenSci Software Peer ReviewLifecycle: maturingCRAN statusruniverse-packageR-CMD-checkCodecov test coverage

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$B = 100.000$ iterations in less than a second!

{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),felm from (lfe)
  • IV:ivreg (from ivreg).

Installation

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")

Theboottest() function

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

Citation

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

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp