Hi all
I'm trying to run a loop of very simple AR(4) regressions for a group (named "pct"), for which I want to save the impulse responses of each series on itself. The responses are to be stored in a matrix titled "ar4". I have written the code below, but whenever I run it there is a "Next found outside of loop" error. Without the next argument it works, but obviously stops at the first variable in the group pct. Any thoughts on what is causing this issue? Thanks in advance
group pct
%v = @wlookup("pct*", "series")
pct.add {%v}
matrix (12,100) ar4
for !i to pct.@count
%name = pct.@seriesname (!i)
var test.ls 1 4 {%name}
test.impulse(12, m ,imp=gen,matbyr=temp) {%name} @ {%name}
colplace(ar4, temp, !i)
d temp
next
stop
"Next found outside of loop" Error
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: "Next found outside of loop" Error
change to
Code: Select all
for !i to pct.@countCode: Select all
for !i=1 to pct.@countRe: "Next found outside of loop" Error
Thanks for the quick reply, apologies but this was a typo in the request on the forum (instead of copy paste-ing, I retyped it a bit too hastily).
The program actually was written containing your suggestion.
Nonetheless the Error occurred.
group pct
%v = @wlookup("pct*", "series")
pct.add {%v}
matrix (12,100) ar4
for !i=1 to pct.@count
%name = pct.@seriesname (!i)
var test.ls 1 4 {%name}
test.impulse(12, m ,imp=gen,matbyr=temp) {%name} @ {%name}
colplace(ar4, temp, !i)
d temp
next
stop
The program actually was written containing your suggestion.
Nonetheless the Error occurred.
group pct
%v = @wlookup("pct*", "series")
pct.add {%v}
matrix (12,100) ar4
for !i=1 to pct.@count
%name = pct.@seriesname (!i)
var test.ls 1 4 {%name}
test.impulse(12, m ,imp=gen,matbyr=temp) {%name} @ {%name}
colplace(ar4, temp, !i)
d temp
next
stop
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: "Next found outside of loop" Error
Code: Select all
create u 100
for !i=1 to 10
series pct!i=nrnd
next
group pct
%v = @wlookup("pct*", "series")
pct.add {%v}
matrix (12,100) ar4
for !i=1 to pct.@count
%name = pct.@seriesname (!i)
var test.ls 1 4 {%name}
test.impulse(12, m ,imp=gen,matbyr=temp) {%name} @ {%name}
colplace(ar4, temp, !i)
d temp
next
Re: "Next found outside of loop" Error
Following you reply, I created a new program file to re-test the code using my own data, and weirdly enough now it did work. I'm not sure what corrupted the other file, but I won't lose any more time on it. Given that I already lost some time on something that could be solved so simply, I am equally thankful to you, as embarrassed to have come to the forum with this.
My apologies, and again many thanks for the responses.
My apologies, and again many thanks for the responses.
Who is online
Users browsing this forum: No registered users and 1 guest
