Page 1 of 1

Multiple regressions with lags

Posted: Wed Jul 29, 2015 5:14 am
by Amorimneto
Good Morning

I want to get all the possible regressions between many independent variables and the same depedent variable.
i am doing the following(i am doing with more betas too, this is just a example):

Code: Select all

for %i x1(-4 to 4) x2(-4 to 4) x3(-4 to 4) x4(-4 to 4) x5(-4 to 4) xs.add {%i} next group xf for %f nivel xf.add {%f} next for !f=1 to xf.@count %fname = xf.@seriesname(!f) for !i=1 to xs.@count-1 %iname = xs.@seriesname(!i) for !j=!i+1 to xs.@count %jname = xs.@seriesname(!j) eq.ls {%fname} c {%iname} {%jname} ;
but i dont know how to exclude all regressions with multiple equals variables like:
y = x1(-1)+ x1(-3)+x1(-4)
y= x1+x1(4)
....

have someway to do all this regressions without the same variable in the same equation? Anyone can help me with this?

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 6:44 am
by EViews Gareth
I'm not sure I follow your question

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 9:09 am
by Amorimneto
lets say that i have GDP, CPI and Interest Rate
and i am trying to explain some variabel y with this 3 variables but i consider diferent lags for them.
so i get:
Y = C + GDP
Y = C + GDP(1)
Y = C + GDP(2)
.
.
.
Y= C + GDP + GDP(1) + GDP(2)
.
.
.
Y= C+ GDP + CPI + CPI(1)
.
.
.
Y= C+ GDP(2) + CPI(-2) + Interest

So i dont want that the same variable with a diferent lag in the same equation like this in red.
i just want combination with diferent variables and your diferent lags

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 9:12 am
by EViews Gareth

Code: Select all

create u 100 series gdp=nrnd series cpi=nrnd series i=nrnd series y=nrnd !n=0 for !i=-4 to 4 for !j=-4 to 4 for !k=-4 to 4 equation eq!n.ls y c gdp(!i) cpi(!j) i(!k) !n=!n+1 next next next
?

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 9:21 am
by Amorimneto
yes, but the problem is that i have 14 variables x and 9 lags for each

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 9:30 am
by EViews Gareth
So write a few more for loops.

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 9:46 am
by Amorimneto
Thz man
its works

Have a nice day

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 10:06 am
by startz
yes, but the problem is that i have 14 variables x and 9 lags for each
Isn't that 14^9 regressions?

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 10:28 am
by Amorimneto
X = independent variable

Re: Multiple regressions with lags

Posted: Wed Jul 29, 2015 10:57 am
by startz
9^14?