Collect Data from the result

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

DanielArmani
Posts: 12
Joined: Wed Apr 13, 2011 4:08 am

Collect Data from the result

Postby DanielArmani » Wed Nov 23, 2011 9:48 am

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
Attachments
sample.wf1
It may help
(348.36 KiB) Downloaded 459 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Collect Data from the result

Postby EViews Gareth » Wed Nov 23, 2011 10:07 am

Create a new table, then set the cells of your new table equal to the corresponding cells in your existing table.

DanielArmani
Posts: 12
Joined: Wed Apr 13, 2011 4:08 am

Re: Collect Data from the result

Postby DanielArmani » Wed Nov 23, 2011 10:39 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Collect Data from the result

Postby EViews Gareth » Wed Nov 23, 2011 10:51 am

Code: Select all

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

DanielArmani
Posts: 12
Joined: Wed Apr 13, 2011 4:08 am

Re: Collect Data from the result

Postby DanielArmani » Thu Nov 24, 2011 6:49 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Collect Data from the result

Postby EViews Gareth » Thu Nov 24, 2011 10:44 am

I'm afraid I don't understand your question.

DanielArmani
Posts: 12
Joined: Wed Apr 13, 2011 4:08 am

Re: Collect Data from the result

Postby DanielArmani » Fri Nov 25, 2011 4:31 am

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
Attachments
result2.prg
(679 Bytes) Downloaded 500 times
sample.wf1
(40.07 KiB) Downloaded 462 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Collect Data from the result

Postby EViews Gareth » Fri Nov 25, 2011 3:10 pm

What does !k do? I can't follow what the !k loop is for.

DanielArmani
Posts: 12
Joined: Wed Apr 13, 2011 4:08 am

Re: Collect Data from the result

Postby DanielArmani » Mon Nov 28, 2011 4:22 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Collect Data from the result

Postby EViews Gareth » Mon Nov 28, 2011 8:46 am

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

DanielArmani
Posts: 12
Joined: Wed Apr 13, 2011 4:08 am

Re: Collect Data from the result

Postby DanielArmani » Mon Nov 28, 2011 9:11 am

It worked, Thank you so much


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest