You can use urca
package in R for this: (say your data is mydf with LN
column as stock returns for London stock market and NY
as stock returns for NY stock market). Following is the sample code(not tested):
install.packages("urca")
library(urca)
mysample <- mydf[, c("NY", "LN")]
myvecm <- ca.jo(mysample, ecdet = "const", type="eigen", K=2, spec="longrun")
myvecm.ols <- cajools(myvecm)
Note: I am assuming that you have used Johansen co-integration test and eigen
statistic; k
indicates the lag number which is 2 for your example, ecdet
is saying that the cointegration has a constant. Please check the manual here for details.