interacting lagged variables

For questions regarding programming in the EViews programming language.

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

pcruz
Posts: 7
Joined: Mon Aug 31, 2015 10:20 am

interacting lagged variables

Postby pcruz » Mon May 08, 2017 1:35 pm

Hi,
Im making a horse race of a huge set of models of the form y = c + y(-1 to -n). So far I've been programming the models as:

for !n = 1 to 100
equation eq_{!n}.ls y c y(-1 to -!n)
next

the thing is that now I have to interact the lagged variables with a dummy "d". Is there anyway to do this in a simple way without writting all the equations down? for instance using something like:

for !n = 1 to 100
equation eq_{!n}.ls y c y(-1 to -!n) y(-1 to -!n)*d
next

Instead of writting

eq_1.ls y c y(-1) d*y(-1)
eq_2.ls y c y(-1) y(-2) d*y(-1) d*y(-2)
... and so on up to n=100

please take note that this is not the exact model that I want to estimate but just an example of what im trying to do.

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

Re: interacting lagged variables

Postby EViews Gareth » Mon May 08, 2017 1:52 pm

Code: Select all

for !n = 1 to 100
   group interacts
   for !j=1 to !n
      interacts.add y(-!j)*dum
   next
   equation eq_{!n}.ls y c y(-1 to -!n) interacts
   d interacts
next

or something similar.
Follow us on Twitter @IHSEViews

pcruz
Posts: 7
Joined: Mon Aug 31, 2015 10:20 am

Re: interacting lagged variables

Postby pcruz » Mon May 08, 2017 1:54 pm

well thought! thanks!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 26 guests