Bootstrap ADF Test I'm interested into the application of bootstrapping for the case of smaller data sets. I tried following reproducible script to compare the results of a "normal" ADF test with a "bootstrapped" test.
library(vars)
library(boot)
data(Canada)
Canada <- data.frame(Canada)

# Standard ADF test
summary(ur.df(Canada["prod"][,1], type = "trend", lags=4, selectlags = "AIC")) # non-stationary

# Bootstrap Test
# Function to obtain test statistics
tstat <- function(x) {
  adf <- ur.df(x, type = "drift", lags=12, selectlags = "AIC")@teststat[1]
  return(adf)
} 

# Test
tstat(Canada["prod"][,1])

# Bootstrapping with 100 replications 
results <- boot(tstat(Canada["prod"][,1]), statistic=tstat, R=100)

# View results
results

# 95% confidence interval 
boot.ci(results)

However, the script returns an error:
> results <- boot(tstat(Canada["prod"][,1]), statistic=tstat, R=100)
Error in statistic(data, original, ...) : unused argument (original)

Questions:


*

*Does it make sense to bootstrap the test? I aspire to do the same with a wald.test.

*Can you resolve the error?

 A: There are (at least) two issues with your implementation.
From ?boot: 
boot(data, statistic, etc.)

where
data

The data as a vector, matrix or data frame. 
statistic   

A function which when applied to data returns a vector containing the statistic(s) of interest. [...] In all other cases statistic must take at least two arguments. The first argument passed will always be the original data. The second will be a vector of indices, frequencies or weights which define the bootstrap sample. [...]
First, what you pass on in the first argument is the test statistic, not the series. Second, your function lacks a second argument specifying the indices.
Something like this runs:
# Function to obtain test statistics
tstat <- function(x,i) {
  adf <- ur.df(x[i], type = "drift", lags=12, selectlags = "AIC")@teststat[1]
  return(adf)
} 
# Bootstrapping with 100 replications 
results <- boot(Canada["prod"][,1], statistic=tstat, R=100)

Still, I do not recommend to actually use this code as bootstrapping unit root tests requires care. Please perform a search for something like "bootstrap unit root tests" to see how correct algorithms for bootstrap unit root tests might look like. It is not to be expected that boot performs such algorithms.
