I'm running ADF test on my data to test for unit root and stationarity, trend, and to find the optimal number of lags using urca
package.
my code is as follows:
> resADFaic <- lapply(InvestmentTS,function(x){ summary(ur.df(x,type="trend", selectlags = "AIC")) })
resADFaic
(this is to lapply
the ur.df
test on all variables in my data)
this test yields, for an example of one of the variables:
###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################
Test regression trend
Call:
lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)
Residuals:
Min 1Q Median 3Q Max
-0.242639 -0.009059 0.002046 0.016602 0.065003
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.1428625 0.0627106 2.278 0.02436 *
z.lag.1 -0.0951398 0.0432642 -2.199 0.02966 *
tt -0.0003743 0.0001349 -2.776 0.00633 **
z.diff.lag 0.0133259 0.0905665 0.147 0.88325
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.03429 on 129 degrees of freedom
Multiple R-squared: 0.05708, Adjusted R-squared: 0.03515
F-statistic: 2.603 on 3 and 129 DF, p-value: 0.05479
Value of test-statistic is: -2.199 2.9918 3.858
Critical values for test statistics:
1pct 5pct 10pct
tau3 -3.99 -3.43 -3.13
phi2 6.22 4.75 4.07
phi3 8.43 6.49 5.47
I am completely lost on how to interpret these results. Firstly, how do I test for the presence of a unit root (stationarity)? Secondly, how can I determine if there is trend? Finally, how do I interpret the lags? what is the tt coefficient?
I have already read: Interpretting R's ur.df (Dickey-Fuller unit root test) results and am still very much lost. Any input would be greatly appreciated.
EDIT: I have figured out the first 2 questions about unit-root and trend. I am still very much confused about the lags.