Page 1 of 1

cointegration lag choice

Posted: Thu Dec 22, 2011 10:37 am
by loooooo
Hi all,

I wrote the code posted below, and seems to be working ok, except that the number of lags, which is needed to be specified as follows: grp.coint(s,numlag)
Here I want numlag to be called from the matrix "vl" but it only takes the default value 4, even with the code written as below.
What should be done?
Your help will be very much appreciated.

Code: Select all

%file = "C:\Desktop\Mydata.xls" wfopen(page=Sheet1) %file smpl 1/01/2005 1/01/2010 genr dbid = d(bid) genr dask = d(ask) var varl.ls 1 2 dbid dask show varl.laglen(20,vname = vl) close varl var varc.ls 1 2 bid ask close varc group grp bid ask grp.coint(s,vl(3))

Re: cointegration lag choice

Posted: Thu Dec 22, 2011 10:38 am
by EViews Gareth
Try extracting the number into a program variable first:

Code: Select all

group grp bid ask !temp = vl(3) grp.coint(s,!temp)

Re: cointegration lag choice

Posted: Thu Dec 22, 2011 10:42 am
by loooooo
This is working beautifully.
Thanks Gareth!!