[R] Johansen Test of Cointegration:How to access rows in R output

Pfaff, Bernhard Dr. Bernhard_Pfaff at fra.invesco.com
Mon Oct 5 09:39:57 CEST 2015


RTFM: help("ca.jo-class")

library(urca)
example(ca.jo)
class(sjf.vecm)
slotNames(sjf.vecm)
slot(sjf.vecm, "cval")
slot(sjf.vecm, "teststat")
slot(sjf.vecm, "V")
slot(sjf.vecm, "Vorg")

Best,
Bernhard

-----Ursprüngliche Nachricht-----
Von: R-help [mailto:r-help-bounces at r-project.org] Im Auftrag von Preetam Pal
Gesendet: Sonntag, 4. Oktober 2015 18:43
An: r-help at r-project.org
Betreff: [R] Johansen Test of Cointegration:How to access rows in R output

Hi guys,

I ran ca.jo(data,type="trace", ecdet="none",k=2) i.e. Johansen's Trace test on R-Studio (package: "urca")and got the output below:

I have 3 questions about this:

A> How do I programmatically access the columns("test", "10pct" etc) in 
A> any
row corresponding to, say, r < = 1 in the output?  I mean, I shall only provide the r-value as an input and all the (column name, column value) pairs will be outputted to me.

B> How do I write a code that will check if the null hypotheses for r 
B> =0,
<= 1, <= 2 and so on  (in this order) are rejected or not; and in case one of them is rejected, it checks the next higher value of r and gives the final inference , something like "Null not rejected for r <= *appropriate r-value from this table* " or "All nulls rejected" or "No null rejected'.

C> Also, I need to extract the eigen vectors from the Cointegration 
C> Matrix
below to get the cointegrated transfoms.

I have attached the data for your perusal. If I need to provide anything more, please let me know.

Regards,
Preetam

######################
# Johansen-Procedure #
######################

Test type: trace statistic , with linear trend in cointegration

Eigenvalues (lambda):
[1] 7.935953e-01 5.444372e-01 4.985327e-01 2.562245e-01 5.551115e-16

Values of teststatistic and critical values of test:

          test 10pct  5pct  1pct
r <= 3 |  6.81 10.49 12.25 16.26
r <= 2 | 22.68 22.76 25.32 30.45
r <= 1 | 40.77 39.06 42.44 48.45
r = 0  | 77.06 59.14 62.99 70.05

Eigenvectors, normalised to first column:
(These are the cointegration relations)

               GDP.l2     HPA.l2       FX.l2        Y.l2   trend.l2
GDP.l2    1.000000000  1.0000000  1.00000000  1.00000000  1.0000000
HPA.l2    2.525511110  0.1569079  0.08077351 -0.22777550 -0.9178250
FX.l2    -8.643729121 -2.5815150  0.17158404 -0.47053012 -4.8528875
Y.l2      0.805229998 -1.4241546  0.07767540  0.02303305  0.5213294
trend.l2  0.006283314  0.0385276 -0.01512016  0.01986813 -0.9516072

Weights W:
(This is the loading matrix)

           GDP.l2      HPA.l2      FX.l2        Y.l2      trend.l2
GDP.d  0.03055313 -0.04681978 -0.8376985 -0.04220534 -1.271960e-17 HPA.d -0.22649596 -0.24287691 -1.6358880  2.03813569 -8.002467e-17
FX.d   0.10327579  0.15150469 -0.1649066  0.37449910 -2.570250e-18
Y.d   -0.35200485  0.56808024 -5.7829738  0.01000965  1.730461e-16
*****************************************************************
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*****************************************************************


More information about the R-help mailing list