loop ls estimation

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Katjes
Posts: 56
Joined: Thu Oct 02, 2008 5:46 am

loop ls estimation

Postby Katjes » Thu Feb 19, 2009 6:18 am

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

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

Re: loop ls estimation

Postby EViews Gareth » Thu Feb 19, 2009 9:28 am

You can use the logic shown here:
viewtopic.php?f=5&t=220
Follow us on Twitter @IHSEViews


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 24 guests