Page 1 of 1

Regressiosn between lagged variables using code

Posted: Sat Oct 11, 2014 9:23 am
by kipfilet_09
Iam having the following coding problem:

I am trying to regress a variable of a certain year over a variable of the previous year.

In the following code,

FOR !j=2 to 5
FOR !I=7 TO 12
equation W_B_Q!j_!I_ALL.ls bq!j_!i c yaq!j_!i-1
next
next

!I=7 TO 12 represents years 7 to 12, and !j represnts quintiles, so for a given quintile (say j=2) and for year 7 I want the following regression:
W_B_Q2_7_ALL.ls bq2_7 c yaq2_6


Simply placing "-1" after !i in order to have the year 6 variable is not working - comparing the two regressions output (one with and onw without the "-1" yield the same exact output, except for the constant term statistics. (I do not want the lagged series of year 7, so yaq!j_!i(-1) is not what I'm looking for).

Any suggestions?

Thank you for your help in advance

Re: Regressiosn between lagged variables using code

Posted: Sat Oct 11, 2014 1:47 pm
by EViews Gareth

Code: Select all

FOR !j=2 to 5 FOR !I=7 TO 12 !k = !i-1 equation W_B_Q!j_!I_ALL.ls bq!j_!i c yaq!j_!k next next

Re: Regressiosn between lagged variables using code

Posted: Sun Oct 12, 2014 2:28 am
by kipfilet_09
Thank you Gareth!

I found out myself using the exact same code just a day before!