Page 1 of 1

Subroutine in a Loop EViews 4

Posted: Tue Nov 27, 2012 10:36 am
by siebenkaese
I am having problems calling a subroutine in a loop.
The code looks like this:

Code: Select all

for !i=1 to 2
   %n = @str(!i)
   equation ar_{%n}.ls {%dep} ar(!i)
   ar_{%n}.makeresids ar_{%n}_res
   %res= "ar_{%n}_res"      
   call autocorrelations

The subroutine creates a vector with the autocorrelation up to a prespecified lag. When I run the program I only get results for the AR(1). It seems like the command "call" stops the loop. If I remove the subroutine, everything is fine, but I obviously donĀ“t get the vector with the autocorrelations.
Does the call command stop the loop or is there another problem ?