Loops within the model object

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

ecardamone
Posts: 40
Joined: Wed Sep 17, 2014 12:23 pm

Loops within the model object

Postby ecardamone » Thu Oct 09, 2014 11:26 am

Hi,

Is it possible to run a loop in the model object? For example, when I set up a model as follows,

model m
m.merge eqGO21
m.merge eqGO22
m.merge eqGO31
m.solve

I get a model object in my workfile that contains three equations, which is what I want. But given that I have 30 equations, I would like to use a loop if possible. However, when I set it up this way,

for %k 21 22 31
model m
m.merge eqGO{%k}
m.solve
next

the model object in the workfile will contain only one equation, the last one, eqgo31.

Thanks for your help!

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

Re: Loops within the model object

Postby EViews Gareth » Thu Oct 09, 2014 11:58 am

Code: Select all

model m
for %k 21 22 31
m.merge eqGO{%k}
next
m.solve
Follow us on Twitter @IHSEViews

ecardamone
Posts: 40
Joined: Wed Sep 17, 2014 12:23 pm

Re: Loops within the model object

Postby ecardamone » Thu Oct 09, 2014 12:08 pm

Thank you!


Return to “Models”

Who is online

Users browsing this forum: No registered users and 30 guests