我想从R中的模型摘要运行ca.jo()
函数后提取test(并且只有这个)信息的临界值。
library(urca)
data(finland)
sjf <- finland
sjf.vecm <- ca.jo(sjf, ecdet = "none", type="eigen", K=2,
spec="longrun", season=4)
summary(sjf.vecm)
如图所示,虽然summary()
返回了很长的结果列表,但它不提供通过summary(sjf.vecm)$[target info]
获取更多指定信息的功能。
######################
# Johansen-Procedure #
######################
Test type: maximal eigenvalue statistic (lambda max) , with linear trend
Eigenvalues (lambda):
[1] 0.30932660 0.22599561 0.07308056 0.02946699
Values of teststatistic and critical values of test:
test 10pct 5pct 1pct
r <= 3 | 3.11 6.50 8.18 11.65
r <= 2 | 7.89 12.91 14.90 19.19
r <= 1 | 26.64 18.90 21.07 25.75
r = 0 | 38.49 24.78 27.14 32.14
Eigenvectors, normalised to first column:
(These are the cointegration relations)
lrm1.l2 lny.l2 lnmr.l2 difp.l2
lrm1.l2 1.0000000 1.000000 1.0000000 1.000000
lny.l2 -0.9763252 -1.323191 -0.9199865 1.608739
lnmr.l2 -7.0910749 -2.016033 0.2691516 -1.375342
difp.l2 -7.0191097 22.740851 -1.8223931 -15.686927
Weights W:
(This is the loading matrix)
lrm1.l2 lny.l2 lnmr.l2 difp.l2
lrm1.d 0.033342108 -0.020280528 -0.129947614 -0.002561906
lny.d 0.022544782 -0.005717446 0.012949130 -0.006265406
lnmr.d 0.053505000 0.046876449 -0.007367715 0.002173242
difp.d 0.005554849 -0.017353903 0.014561151 0.001531004
如何仅从关键值表中获取结果,以某种方式重新格式化并生成如下所示的表:
Test | test | 10pct | 5pct | 1pct
----------------------------------------
r <= 3 | 3.11 | 6.50 | 8.18 | 11.65
r <= 2 | 7.89 | 12.91 | 14.90 | 19.19
r <= 1 | 26.64 | 18.90 | 21.07 | 25.75
r = 0 | 38.49 | 24.78 | 27.14 | 32.14
答案 0 :(得分:3)
您可以保存summary
的结果,然后使用
S = summary(sjf.vecm)
str(S)
看一下,你可以看到如何获得你想要的结果。
cbind(S@teststat, S@cval)
10pct 5pct 1pct
r <= 3 | 3.110626 6.50 8.18 11.65
r <= 2 | 7.892417 12.91 14.90 19.19
r <= 1 | 26.642484 18.90 21.07 25.75
r = 0 | 38.489175 24.78 27.14 32.14