Several Regressions

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Several Regressions

Postby Puko » Wed May 26, 2010 1:54 am

Hi!
I'm new to eviews programming. I'm using Eviews 6.0
I would be very grateful if you could help me.I have been reading the manual "Command and Programming reference" but I´m mixed up over this. I'm working with ten series (returns of ten currencies). Each of them has near 3000 data.
I would need to make linear regression of each currency against each pair of the other nine currencies. Just to obtain the R2.
How can i program that?
Thanks a lot for your time and help.
Regards.

nadja123
Posts: 72
Joined: Thu Aug 06, 2009 10:43 am

Re: Several Regressions

Postby nadja123 » Wed May 26, 2010 4:33 am

Hi Puko,
if you name your 10 currency series as curr1, curr2, ..., curr10, is this what you mean?

Code: Select all

for !i = 1 to 10 for !j = 1 to 10 equation eq_{!i}_{!j}.ls curr{!i} c curr{!j} next next
Hlp doc search: FOR LOOP, EQUATION, PROGRAM VARIABLES

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Wed May 26, 2010 5:13 am

Thanks!! I think so!! I will try later this evening!!
Thanks again!!

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

Re: Several Regressions

Postby EViews Gareth » Wed May 26, 2010 8:08 am

Might want to change the code slightly:

Code: Select all

for !i = 1 to 10 for !j = 1 to 10 if !i<>! then equation eq_{!i}_{!j}.ls curr{!i} c curr{!j} endif next next
You might find it useful to read through the Programming Guide too.

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Wed May 26, 2010 8:29 am

Thanks, but what i really want to make is several regressions with two regressors in each.
With this program

for !i = 1 to 10
for !j = 1 to 10
equation eq_{!i}_{!j}.ls curr{!i} c curr{!j}
next
next

I obtain the regressions but with only one regressor.

I would like equations like this: .ls curr{!i} c curr{!j} curr{!z}

I have tried the following but there must be some mistakes. ¿Could you help me again please?

for !i = 1 to 10
for !j = 1 to 10
for !z = 1 to 10
equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z}
next
next
next

nadja123
Posts: 72
Joined: Thu Aug 06, 2009 10:43 am

Re: Several Regressions

Postby nadja123 » Wed May 26, 2010 12:27 pm

Might want to change the code slightly:
Indeed. Sorry! I better reply no posts should I do it too quickly and with mistakes.

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Thu May 27, 2010 7:27 am

I have also tried with this program, but there are mistakes.

for !i = 1 to 10
for !j = 1 to 10
for !z = 1 to 10
if !z=!y then
equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z}
endif
next
next
next

Any idea please? Thanks.

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

Re: Several Regressions

Postby EViews Gareth » Thu May 27, 2010 8:00 am

Code: Select all

for !i = 1 to 10 for !j = 1 to 10 for !z = 1 to 10 if !i<>!j and !i<>!z then equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z} endif next next next

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Fri May 28, 2010 4:25 am

Hi Gareth,

I had problems with you program, but at the end i have one that is working:

for !i = 1 to 10
for !j = 1 to 10
for !z = 1 to 10
if !z=!j then
!k=1
else
equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z}
endif
next
next
next

But now, i would like to extract only the R2 coefficients of each one of the regression. I have tried reading your Programming Guide and the example of R2 but i am not able.
Could you please help me?
Thanks again!!

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

Several Regressions

Postby EViews Gareth » Fri May 28, 2010 7:04 am

What have you tried and how did it not work?

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Fri May 28, 2010 7:25 am

With that, i get the problem "near singular matrix"

for !i = 1 to 10
for !j = 1 to 10
for !z = 1 to 10
if !i<>!j and !i<>!z then
equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z}
endif
next
next
next

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

Re: Several Regressions

Postby EViews Gareth » Fri May 28, 2010 7:54 am

Code: Select all

for !i = 1 to 10 for !j = 1 to 10 for !z = 1 to 10 if !i<>!j and !i<>!z and !j<>!z then equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z} endif next next next

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Mon May 31, 2010 12:24 am

Thanks!! That one works perfectly!

Could you please help me getting only the R2 of these regressions?? That´s the last thing i would need.

Thanks again!!

Puko
Posts: 8
Joined: Wed May 26, 2010 1:38 am

Re: Several Regressions

Postby Puko » Tue Jun 01, 2010 11:53 pm

Any help please to get only the R2 of the regressions from here.

Thanks!!

for !i = 1 to 10
for !j = 1 to 10
for !z = 1 to 10
if !i<>!j and !i<>!z and !j<>!z then
equation eq_{!i}_{!j}_{!z}.ls curr{!i} c curr{!j} curr{!z}
endif
next
next
next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests