Multiple regressions with lags

For questions regarding programming in the EViews programming language.

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

Amorimneto
Posts: 11
Joined: Thu Jan 15, 2015 11:55 am

Multiple regressions with lags

Postby Amorimneto » Wed Jul 29, 2015 5:14 am

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?

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

Re: Multiple regressions with lags

Postby EViews Gareth » Wed Jul 29, 2015 6:44 am

I'm not sure I follow your question

Amorimneto
Posts: 11
Joined: Thu Jan 15, 2015 11:55 am

Re: Multiple regressions with lags

Postby Amorimneto » Wed Jul 29, 2015 9:09 am

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

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

Re: Multiple regressions with lags

Postby EViews Gareth » Wed Jul 29, 2015 9:12 am

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
?

Amorimneto
Posts: 11
Joined: Thu Jan 15, 2015 11:55 am

Re: Multiple regressions with lags

Postby Amorimneto » Wed Jul 29, 2015 9:21 am

yes, but the problem is that i have 14 variables x and 9 lags for each

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

Re: Multiple regressions with lags

Postby EViews Gareth » Wed Jul 29, 2015 9:30 am

So write a few more for loops.

Amorimneto
Posts: 11
Joined: Thu Jan 15, 2015 11:55 am

Re: Multiple regressions with lags

Postby Amorimneto » Wed Jul 29, 2015 9:46 am

Thz man
its works

Have a nice day

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: Multiple regressions with lags

Postby startz » Wed Jul 29, 2015 10:06 am

yes, but the problem is that i have 14 variables x and 9 lags for each
Isn't that 14^9 regressions?

Amorimneto
Posts: 11
Joined: Thu Jan 15, 2015 11:55 am

Re: Multiple regressions with lags

Postby Amorimneto » Wed Jul 29, 2015 10:28 am

X = independent variable

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: Multiple regressions with lags

Postby startz » Wed Jul 29, 2015 10:57 am

9^14?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest