rolling reg with diffrent y and diffrent x variables

For questions regarding programming in the EViews programming language.

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

dicuans
Posts: 2
Joined: Sun Jun 11, 2017 10:48 am

rolling reg with diffrent y and diffrent x variables

Postby dicuans » Sun Jun 11, 2017 5:34 pm

Hi all

Brass tacks, i'm doing a multiple regression consisting different dependent variables and independent variables in each equations.
some thing like this:

y1 = c + a + a(-1) + x1 + x1(-1) + e
y2 = c + a + a(-1) + x2 + x2(-1) + e
y3 = c + a + a(-1) + x3 + x3(-1) + e
.
.
.
yn = c + a + a(-1) + xn+ xn(-1) + e

could you help me with the code, also I want to store the r-squared. I've tried using eq{!i}_{!j} but i never succeed.

previously, I managed to do this regrression:

y1 = c + a + a(-1) + b +b(-1) + e
y2 = c + a + a(-1) + b +b(-1) + e
y3 = c + a + a(-1) + b +b(-1) + e
.
.
yn = c + a + a(-1) + b +b(-1) + e

here is the code:

Code: Select all

'create vector to store r-squares vector(22) r2s 'create empty equation to be used inside the loop equation eq ''counter of how many equations we have run !rowcounter=1 'run pairwise regressions between each series for !i=1 to agr.@count %iname = agr.@seriesname(!i) equation eq.ls {%iname} c r_ihsg r_ihsg(-1) r_agr r_agr(-1) r2s(!rowcounter) = eq.@r2 !rowcounter = !rowcounter+1 next
another one:

Code: Select all

'create vector to store r-squares vector(63) r2s 'create empty equation to be used inside the loop equation eq ''counter of how many equations we have run !rowcounter=1 'run pairwise regressions between each series for !i=1 to bas.@count %iname = bas.@seriesname(!i) equation eq.ls {%iname} c r_ihsg r_ihsg(-1) r_bas r_bas(-1) r2s(!rowcounter) = eq.@r2 !rowcounter = !rowcounter+1 next
could you help me to make single program for this (the first equation up there), instead multiple code?

regards,
dicuans

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

Re: rolling reg with diffrent y and diffrent x variables

Postby EViews Gareth » Sun Jun 11, 2017 9:10 pm

It is a bit abstract, but for:
y1 = c + a + a(-1) + x1 + x1(-1) + e
y2 = c + a + a(-1) + x2 + x2(-1) + e
y3 = c + a + a(-1) + x3 + x3(-1) + e
.
.
.
yn = c + a + a(-1) + xn+ xn(-1) + e

You could do something like:

Code: Select all

'create vector to store r-squares vector(22) r2s 'create empty equation to be used inside the loop equation eq ''counter of how many equations we have run !rowcounter=1 'run pairwise regressions between each series for !i=1 to y_group.@count %yname = y_group.@seriesname(!i) %xname = x_group.@seriesname(!i) equation eq.ls {%yname} c r_ihsg r_ihsg(-1) {%xname} {%xname}(-1) r2s(!rowcounter) = eq.@r2 !rowcounter = !rowcounter+1 next

dicuans
Posts: 2
Joined: Sun Jun 11, 2017 10:48 am

Re: rolling reg with diffrent y and diffrent x variables

Postby dicuans » Tue Jun 13, 2017 6:53 pm

Hi Gareth,

It works, thank you for the help!.

Regards from Indonesia,
dicuans


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests