Page 1 of 1

Collect Data from the result

Posted: Wed Nov 23, 2011 9:48 am
by DanielArmani
I am using Eviews6. I have writen a program by help of one of my friends to get cointegration test from my data, create equation and get the residuals on a table. My program is as follow:

for !i = 1 to 7
for !j=1 to 7
if !j>!i then

group gr_{!i}_{!j} ser0{!i} ser0{!j} 'Creates a group of log prices to check for cointegration
freeze(coint_{!i}_{!j}) gr_{!i}_{!j}.coint(c,cvsize=0.05) 'Creates a copy (freezes) of coint table
equation equa_{!i}_{!j}.ls ser0{!i} c ser0{!j} 'Creates a ls Equation'
series resid_{!i}_{!j}=resid 'Create residual Series'

endif
next
next

I need to know how I can write extra lines of program to get the cointegration test result in one table so I wont need to open all cointegration results individually to see the result. For example a table with following columns A5, A16 and E13 from cointegration tables. I will enclose a sample of the result to help you to understand my problem.

Thanks

Daniel

Re: Collect Data from the result

Posted: Wed Nov 23, 2011 10:07 am
by EViews Gareth
Create a new table, then set the cells of your new table equal to the corresponding cells in your existing table.

Re: Collect Data from the result

Posted: Wed Nov 23, 2011 10:39 am
by DanielArmani
Hi again,

Sorry to bother you, As I am a very biginer in writing program, is any chance to ask you writting me an example of codes for setting the cells of a new table equal to the corresponding cells in the existing table, please?

regards

Re: Collect Data from the result

Posted: Wed Nov 23, 2011 10:51 am
by EViews Gareth

Code: Select all

table a a(1,1) = "hello" table b b(3,3) = a(1,1)

Re: Collect Data from the result

Posted: Thu Nov 24, 2011 6:49 am
by DanielArmani
Thank you for your reply, i wonder how I can address the next results to the next row of the same new table. If I want to explain, as i am trying to pull the interested result into one table from my cointegration test tables, I have made a new table RESULT and addresses the each sell to the first pair. however there going to be several pairs that I need their result to pulled into my result table.

for !i = 1 to 7
for !j=1 to 7
if !j>!i then

group gr_{!i}_{!j} ser0{!i} ser0{!j} 'Creates a group of log prices to check for cointegration
freeze(coint_{!i}_{!j}) gr_{!i}_{!j}.coint(c,cvsize=0.05) 'Creates a copy (freezes) of coint table

table result
result(1,1)=coint_1_2(5,1)
result(1,2)=coint_1_2(16,1)
result(1,3)=coint_1_2(13,5)

endif
next
next


I wonder if you can help me? I tried to use {n=(1 to n)} but it didn't work.

Thanks again

Re: Collect Data from the result

Posted: Thu Nov 24, 2011 10:44 am
by EViews Gareth
I'm afraid I don't understand your question.

Re: Collect Data from the result

Posted: Fri Nov 25, 2011 4:31 am
by DanielArmani
Hi, sorry english is not my first language, but let me explain again.

In my sample file I have seven series that I get cointegration test between each of them ( 1&2, 1&3, 1&4,...,2&3, 2&4,...,6&7), there will be 21 table result of this test. then I have to open each of this table manually to collect the data, which are in cell A5, A16 and E13.(very time consumming)

I need to add some code to my program to get these result onto one table. by your advised I have managed to do that but it is not complete as I dont know where in my codes is wrong ( the table I have made is only collect the last pair result and not the rest)

I have enclosed the code and sample file, so if you try them you will see that in the RESULT table there will be only one pair result and not the rest.

Please help me to get the results of all pairs onto RESULT table.

Regards

Re: Collect Data from the result

Posted: Fri Nov 25, 2011 3:10 pm
by EViews Gareth
What does !k do? I can't follow what the !k loop is for.

Re: Collect Data from the result

Posted: Mon Nov 28, 2011 4:22 am
by DanielArmani
Hi Gareth,

!k has to diresct the next pair result into next row of RESULT table.

I wrote it 1 to 100 as I did not know how to calcculate the number of tables in eviews, but for example in this case they will be 21.

Re: Collect Data from the result

Posted: Mon Nov 28, 2011 8:46 am
by EViews Gareth
Well, the problem is that !k isn't changing inside the !i and !j loop, it remains at 1 for all values of !i and !j, then it remains at 2 for all values of !i and !j etc....

You might want to have something (and this is just a sketch of the idea, I'm not guaranteeing it will work) like:

Code: Select all

!row = 1 for !i = 1 to 7 for !j=1 to 7 if !j>!i then group gr_{!i}_{!j} ser0{!i} ser0{!j} 'Creates a group of prices to check for cointegration freeze(coint_{!i}_{!j}) gr_{!i}_{!j}.coint(c,cvsize=0.05) 'Creates a copy (freezes) of coint table table result ' To create a table and pull the result of all cointegration result into it setcolwidth(result,1,20) 'To change the width of the columns setcolwidth(result,2,45) setcolwidth(result,3,15) result(!row,1)=coint_{!i}_{!j}(5,1) 'needed results result(!row,2)=coint_{!i}_{!j}(16,1) result(!row,3)=coint_{!i}_{!j}(13,5) !row = !row + 1 endif next next

Re: Collect Data from the result

Posted: Mon Nov 28, 2011 9:11 am
by DanielArmani
It worked, Thank you so much