Page 1 of 1
Several Regressions
Posted: Wed May 26, 2010 1:54 am
by Puko
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.
Re: Several Regressions
Posted: Wed May 26, 2010 4:33 am
by nadja123
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
Re: Several Regressions
Posted: Wed May 26, 2010 5:13 am
by Puko
Thanks!! I think so!! I will try later this evening!!
Thanks again!!
Re: Several Regressions
Posted: Wed May 26, 2010 8:08 am
by EViews Gareth
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.
Re: Several Regressions
Posted: Wed May 26, 2010 8:29 am
by Puko
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
Re: Several Regressions
Posted: Wed May 26, 2010 12:27 pm
by nadja123
Might want to change the code slightly:
Indeed. Sorry! I better reply no posts should I do it too quickly and with mistakes.
Re: Several Regressions
Posted: Thu May 27, 2010 7:27 am
by Puko
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.
Re: Several Regressions
Posted: Thu May 27, 2010 8:00 am
by EViews Gareth
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
Re: Several Regressions
Posted: Fri May 28, 2010 4:25 am
by Puko
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!!
Several Regressions
Posted: Fri May 28, 2010 7:04 am
by EViews Gareth
What have you tried and how did it not work?
Re: Several Regressions
Posted: Fri May 28, 2010 7:25 am
by Puko
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
Re: Several Regressions
Posted: Fri May 28, 2010 7:54 am
by EViews Gareth
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
Re: Several Regressions
Posted: Mon May 31, 2010 12:24 am
by Puko
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!!
Re: Several Regressions
Posted: Tue Jun 01, 2010 11:53 pm
by Puko
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