Dear all,
 
I am writing because I am facing discrepancies between the outputs of the Johansen cointegration tests in Gretl and R. Concretely, both softwares yield exactly the same test statistics, but the critical values are different (therefore, the decision about the number of cointegration vectors not always coincide). Attached is a data with 62 yearly observations where the two first columns are treated as endogenous variables (GDP and NDB) and the last is a dummy variable treated as exogenous. I don't include restricted drift.
 
In the window of the Johansen cointegration test I selected lag order 6; GDP and NDB in Variables to test; bnprivatefinancingdummy in Exogenous variables (Unrestricted) and at the botton Unrestricted constant. And the output is,
 
Johansen test:
Number of equations = 2
Lag order = 6
Estimation period: 1959 - 2014 (T = 56)
Case 3: Unrestricted constant
Exogenous regressor(s): bnprivatefinancingdummy 
Log-likelihood = 280.81 (including constant term: 121.889)
Cointegration tests, ignoring exogenous variables
Rank Eigenvalue Trace test  p-value  Lmax test  p-value
   0    0.30870     26.346 [0.0006]     20.674 [0.0033]
   1   0.096321     5.6718 [0.0172]     5.6718 [0.0172]
Corrected for sample size (df = 42)
Rank Trace test p-value
   0     26.346 [0.0008]
   1     5.6718 [0.0210]
Note: in general, the test statistics above are valid only in the
absence of additional regressors.
eigenvalue     0.30870     0.096321 
beta (cointegrating vectors)
baGDP          -13.181      -9.6509 
bdNDB           2.6539       3.3911 
alpha (adjustment vectors)
baGDP         0.015526   -0.0053853 
bdNDB        -0.046274    -0.077268 
renormalized beta
baGDP           1.0000      -2.8460 
bdNDB         -0.20135       1.0000 
renormalized alpha
baGDP         -0.20465    -0.018262 
bdNDB          0.60993     -0.26202 
long-run matrix (alpha * beta')
                 baGDP        bdNDB
baGDP         -0.15267     0.022943 
bdNDB           1.3556     -0.38483 
 
 
I guess most of you are familiar with R. In R the code is the following:
 
johansen<-ca.jo(data[1:2], type = "trace", ecdet = "none", K = 6, spec = "longrun", dumvar = data[3])
summary(johansen)
 
And the output is this,
###################### 
# Johansen-Procedure # 
###################### 

Test type: trace statistic , with linear trend 

Eigenvalues (lambda):
[1] 0.30869583 0.09632144

Values of teststatistic and critical values of test:

          test 10pct  5pct  1pct
r <= 1 |  5.67  6.50  8.18 11.65
r = 0  | 26.35 15.66 17.95 23.52

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

           baGDP.l6   bdNDB.l6
baGDP.l6  1.0000000  1.0000000
bdNDB.l6 -0.2013471 -0.3513728

Weights W:
(This is the loading matrix)

          baGDP.l6   bdNDB.l6
baGDP.d -0.2046459 0.05197298
bdNDB.d  0.6099287 0.74570305
 
 
As you can see and as I mentioned before, the test statistics is the same, but the critical values (p-values) differ significantly. And this discrepancy in the critical values (and p-values) has been persistent in the case of other cointegration tests using other series. In this example, R indicates one cointegration vector and Gretl two cointegration vectors (at 5% of significance).
 
 
Please, can you tell me why there is the discrepancy?
 
Kind regards,
 
Reynaldo Senra