首先你要知道单位根检验是要检验什么。一般使用adf.test来判断有没有单位根,但你不能根据它的p值判断它是否平稳。但是你要具体看这个序列是什么形式的你还是要使用ur.df检验。这个检验对应的一般模型是

,一般先检验趋势项,因为当趋势项存在的情况下漂移项对式子的影响不大,所以用程序来就是ur.df(data,type="trend")。然后得到的结果像下面这种,我将自己的结果拷过来进行详细说明:
> summary(ur.df(ap,type='trend'))
###############################################
# 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
-3.5040 -0.5343 0.0013 0.6359 2.1332
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.07654 0.14947 0.512 0.609
z.lag.1 -0.31371 0.05532 -5.671 4.67e-08 ***
tt 0.02400 0.00434 5.530 9.45e-08 ***
z.diff.lag -0.04811 0.06908 -0.696 0.487
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.081 on 210 degrees of freedom
Multiple R-squared: 0.1684, Adjusted R-squared: 0.1566
F-statistic: 14.18 on 3 and 210 DF, p-value: 1.889e-08
Value of test-statistic is: -5.6706 11.1499 16.1189
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
这个结果最重要的就是Value of test-statistic is: -5.6706 11.1499 16.1189 这部分。第一个数字是tau3,对应公式里面的π,
它对应的假设是H0:π=0(有单位根);H1:π<0(没有单位根)。如果原假设被拒绝说明没有单位根直接结束检验,否则进行第二步,看参数phi3,也就是公式里的趋势项,它对应的假设是H0:β2=0,H1:β2不为0.如果承认原假设,那么就证明没有趋势项,可以直接看参数phi2,即公式的漂移项,如果拒绝原假设,则为有漂移项。也可以
用程序就是summary(ur.df(data,type="drift"))
P.S使用这一步的前提条件是确定不存在趋势项。
此时对应的公式为

。为了更好说明,我这里再重新贴一下代码结果:Call:
lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)
Residuals:
Min 1Q Median 3Q Max
-4.0725 -0.4683 -0.0858 0.6983 2.6337
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.24393 0.15630 1.561 0.12009
z.lag.1 -0.01961 0.01628 -1.205 0.22960
z.diff.lag -0.19340 0.06822 -2.835 0.00503 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.154 on 211 degrees of freedom
Multiple R-squared: 0.04734, Adjusted R-squared: 0.03831
F-statistic: 5.243 on 2 and 211 DF, p-value: 0.005996
Value of test-statistic is: -1.2049 1.2573
Critical values for test statistics:
1pct 5pct 10pct
tau2 -3.46 -2.88 -2.57
phi1 6.52 4.63 3.81
也是看Value of test-statistic is: -1.2049 1.2573。tau2对应公式的π,phi1对应公式β1。如果得到结论是没有漂移项,你可以试一试summary(ur.df(data,type="none"))
。但个人觉得很多余啊。。。。。。。。。。。。。。。。。。
如果 1pct 5pct 10pct
tau2 -3.46 -2.88 -2.57
phi1 6.52 4.63 3.81看不懂可以私信我。。。这里就不写了。希望可以帮助你啊~~~