Page 1 of 1

Multiple regressions and changing independent variables

Posted: Wed Dec 14, 2011 4:18 am
by PeterDeJongh
Hi guys,

For me programming Eviews is totally new, so I first worked through the guide available, but still haven't found what I was looking for.
In my case, I have got several dependent variables, but I know how to change those in a program.

However, I got several independent variables, of which some are fixed, and others are not. The first "fixed" variables are certainly needed for the regressions, but I want to know which other variables do give more explanation power. But I do not know how to implement this in my program.

So the regressions look like this:
y(1) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v1)
y(1) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v2)
y(1) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v3)
y(2) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v1)
y(2) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v2)
y(2) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v3)
y(3) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v1)
y(3) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v2)
y(3) = c + x(1) + x(2) +x(3) + x(4) + x(5) + x(6) + x(v3)

Is there a way to programm this, and if so, can somebody tell me how?

Thanks a lot in advance

Re: Multiple regressions and changing independent variables

Posted: Wed Dec 14, 2011 8:50 am
by EViews Gareth
What have you done so far?

Re: Multiple regressions and changing independent variables

Posted: Thu Dec 15, 2011 2:10 am
by PeterDeJongh
Not too much I guess. I used the program from the "introductions" part on this website, which creates different regressions for all variables using the loops etc.
I sort of rewrote it to make it accessable for my own dataset.

This is what I got so far:

for !i=1 to sectors.@count
%iname = sectors.@seriesname(!i)
for !j=1 to control.@count
%jname = control.@seriesname(!j)
for !k=1 to commodities.@count
%kname = commodities.@seriesname(!k)
eq.ls {%iname} c {%jname} {%kname}
r2s(!rowcounter) = eq.@r2
!rowcounter = !rowcounter+1
next
next
next

Point is though, that from the "control" group, all the variables should allways be in the regressions. Probably this is a pretty simple command, but I do not know how to implement this in the program control window.

Thanks in Advance!!

Re: Multiple regressions and changing independent variables

Posted: Thu Dec 15, 2011 8:42 am
by EViews Gareth
If the control group is always in the regression, you don't need to loop over it:

Code: Select all

%control = control.@members for !i=1 to sectors.@count %iname = sectors.@seriesname(!i) for !k=1 to commodities.@count %kname = commodities.@seriesname(!k) eq.ls {%iname} c {%control} {%kname} r2s(!rowcounter) = eq.@r2 !rowcounter = !rowcounter+1 next next