Page 1 of 1

Several lags programming

Posted: Mon Oct 26, 2015 1:15 pm
by AntonioAcha
Hello, I'm getting started into the Eviews programming and have an issue with telling Eviews to calculate multiple equations with lags of the independent variable. I did not find this in previous post, so I hope I'm not repeating a question made before.

I need to do this
Y C X1
Y C X1 X1(-1)
Y C X1 X1(-1) X1(-2)
Y C X1 X1(-1) X1(-2) X1(-3)
Y C X1 X1(-1) X1(-2) X1(-3) X1(-4)
Y C X1 X1(-1) X1(-2) X1(-3) X1(-4) X1(-5)
Y C X1 X1(-1) X1(-2) X1(-3) X1(-4) X1(-5) X1(-6)
.... and so on

therefore I created something like this:
series y=nrnd
series x=nrnd
for !i = -6 to -1
equation lag_x_(7+ { !i }).ls y c x_1({ !i } to 0)
next

Eviews do not allow me to name the equation in that way. I want that when the regression includes only one lag it will be lag_x_1 , and when I have the sixth lag it will be lag_x_6. Is there a way to do this?

Furthermore, after having the seven equation I would like to have them in a table with their respective coefficient and sd.

Thanks in advance for any help!

Re: Several lags programming

Posted: Mon Oct 26, 2015 2:24 pm
by EViews Gareth

Code: Select all

series y=nrnd series x=nrnd for !i = 1 to 6 equation lag_x_!i.ls y c x(0 to -!i) next

Re: Several lags programming

Posted: Tue Oct 27, 2015 6:12 am
by AntonioAcha
Thanks you very much