Hello - sorry if this a very basic question...
I'm trying to nest two for loops, where the inner loop selects a group of variables based on the value of the outer loop (in this case, country on the outer, product on the inner).
Unfortunately, I can't seem to make the line %prod = @wlookup(@wunion("in*",{%z})) work.
Any suggestions or advice appreciated, thanks.
----------------------------------------------------
%cntry = "be de uk"
for %z {%cntry}
%prod = @wlookup(@wunion("in*",{%z}))
for %y {%prod}
equation eq_{%y}.stepls {%y} econs
eq_{%y}.forecast {%y}_ls
next
next
-------------------------------------------------
@wlookup with loop variable
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @wlookup with loop variable
Can't you just use:
Code: Select all
%cntry = "be de uk"
for %z {%cntry}
%prod = @wlookup("in*"+%z)
for %y {%prod}
equation eq_{%y}.stepls {%y} econs
eq_{%y}.forecast {%y}_ls
next
next
Re: @wlookup with loop variable
Perfect, thank you for the help and the quick response.
Re: @wlookup with loop variable
for !%y = bah kuw oma qat sau uni
for !%x = _co2 _pop _gdp _tpes _tfc
genr l%y%x= log(%y%x)
next
next
a very basic question....but It does not work...
Thanks
for !%x = _co2 _pop _gdp _tpes _tfc
genr l%y%x= log(%y%x)
next
next
a very basic question....but It does not work...
Thanks
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @wlookup with loop variable
Code: Select all
for %y bah kuw oma qat sau uni
for %x _co2 _pop _gdp _tpes _tfc
genr l{%y}{%x}= log({%y}{%x})
next
next
Who is online
Users browsing this forum: No registered users and 2 guests
