Page 1 of 1

loop ls estimation

Posted: Thu Feb 19, 2009 6:18 am
by Katjes
Hi, today I'm looking for a neat solution for the number of exogenous variables.
Suppose I loop over the lagged variables of x
for !h=0 to 2
equation eq0.ls y c x(-!h)
next

this produces the equations:
equation eq0.ls y c x(0)
equation eq0.ls y c x(-1)
equation eq0.ls y c x(-2)

Now, what I want is that all lagged variables are included until !h, not only the h-th.
Something that look like:
equation eq0.ls y c x(0)
equation eq0.ls y c x(0) x(-1)
equation eq0.ls y c x(0) x(-1) x(-2)

Is there a command or option?
(I now, that it's easy to do it manually for the example, but if you have more than one x and more than 2 h-th than its bulky !!!)
Thanks in advance

Re: loop ls estimation

Posted: Thu Feb 19, 2009 9:28 am
by EViews Gareth
You can use the logic shown here:
http://forums.eviews.com/viewtopic.php?f=5&t=220