0
我想將分析(單位根分析)的某些值提取到列表中(讓我們說list1)。但是我無法提取這些值。從R中的分析輸出中提取一些值
數據低於:
> data
[1] 0.000000000 0.000000000 -0.016800849 -0.005674109 -0.028815092 0.011629070 -0.005805695 0.011561935 0.005739148 0.005690635 0.022474958
[12] 0.038147810 -0.005355004 0.026521835 0.025850717 0.025185460 -0.004994926 0.019804531 -0.014809606 0.004956367 -0.009951292 0.067665001
[23] 0.009303233 0.009217480 -0.018520713 -0.018870213 -0.038843496 -0.009951292 0.058274404 0.063954399 0.043288692 0.081342150 0.015505687
[34] -0.007722791 0.007722791 0.037743885 -0.007435669 0.000000000 -0.007491372 -0.015153238 -0.071171939 -0.041850997 -0.008572604 -0.026204595
[45] 0.026204595 0.042192350 -0.016668594 0.024899845 -0.008231251 0.079403190
而且代碼如下所示:
library(urca)
adf1<-ur.df(data, type = "drift", lags = 1, selectlags = "BIC")
總結思想探析的是象下面這樣:
> summary(adf1)
###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################
Test regression drift
Call:
lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)
Residuals:
Min 1Q Median 3Q Max
-0.070631 -0.021526 -0.004443 0.015088 0.072395
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.004997 0.004444 1.125 0.26674
z.lag.1 -0.546913 0.178716 -3.060 0.00372 **
z.diff.lag -0.173281 0.159606 -1.086 0.28340
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.0298 on 45 degrees of freedom
Multiple R-squared: 0.3167, Adjusted R-squared: 0.2863
F-statistic: 10.43 on 2 and 45 DF, p-value: 0.0001899
Value of test-statistic is: -3.0602 4.7498
Critical values for test statistics:
1pct 5pct 10pct
tau2 -3.58 -2.93 -2.60
phi1 7.06 4.86 3.94
我想提取
- -3.0602「的檢驗統計值」和4.7498列表1
- 作爲第一個參數「多重R平方」爲0.3167列表1的第二個參數
但是,我不能設法做到這一點。 adf1的類似如下。
> class(adf1)
[1] "ur.df"
attr(,"package")
[1] "urca"
我會很樂意提供任何幫助。非常感謝。