Skip to contents
#> Please cite as:
#>  Fischer & Roodman. (2021). fwildclusterboot: Fast Wild Cluster.
#>  Bootstrap Inference for Linear Regression Models.
#>  Available from

fwildclusterboot provides an R binding to the WildBootTests.jl implementation of the “fast” wild cluster bootstrap.

Installation and Set-Up

We recommend to install Julia from its official website

The JuliaConnectoR.utils packages helps you to link R and Julia and to install WildBootTests.jl from within R.

connect_julia_r() # instructions to connect Julia and R
install_julia_packages("WildBootTests.jl") # install WildBootTests.jl

By default, the functions above install the most recent stable releases of WildBootTests.jl.

If Julia and WildBootTests.jl are already installed, you can check if the installed versions match the SystemRequirements by running


To set the number of threads for use in Julia, you can run

set_julia_nthreads() # instructions to set nthreads for Julia

and follow the provided instructions.

The engine function argument

You can run the wild cluster bootstrap through WildBootTests.jl via the engine function argument:

# load data set voters included in fwildclusterboot
# estimate the regression model via lm
lm_fit <- lm(
  proposition_vote ~ treatment + ideology1 + log_income + Q1_immigration ,
  data = voters

The first function call of boottest() will JIT-compile all required Julia code - this will take around 10-30 seconds. Note that if you re-start your R session, all Julia code will have to be re-compiled.

boot_lm <- boottest(
  clustid = "group_id1",
  param = "treatment",
  B = 9999,
  engine = "WildBootTests.jl"

If you decide that all your analyses should run through WildBootTests.jl, you can set a global variable via


All subsequent calls of boottest() will then automatically run WildBootTests.jl (unless you explicitly specify engine = "R").

# after setting setBoottest_engine("WildBootTests.jl"), 
# the code below runs WildBootTests.jl without
# specifying 'engine = "WildBootTests.jl"'
  clustid = "group_id1", 
  param = "treatment",
  B = 9999