x has
a unit root.adf.test(x, alternative = c("stationary", "explosive"),
k = trunc((length(x)-1)^(1/3)))"stationary" (default) or "explosive". You can
specify just the initial letter."htest" containing the following components:k. The default value of
trunc((length(x)-1)^(1/3)) corresponds to the suggested upper
bound on the rate at which the number of lags, k, should be
made to grow with the sample size for the general ARMA(p,q)
setup. Note that for k equals zero the standard Dickey-Fuller
test is computed. The p-values are interpolated from Table 4.2, p. 103
of Banerjee et al. (1993). If the computed statistic is outside the
table of critical values, then a warning message is generated.
Missing values are not allowed.pp.testx <- rnorm(1000) # no unit-root
adf.test(x)
y <- diffinv(x) # contains a unit-root
adf.test(y)Run the code above in your browser using DataLab