Subroutine in a Loop EViews 4

For questions of any nature based on EViews 5 or earlier versions of EViews.

Moderators: EViews Gareth, EViews Moderator

Posts: 5
Joined: Tue Nov 06, 2012 2:58 am

Subroutine in a Loop EViews 4

Postby siebenkaese » Tue Nov 27, 2012 10:36 am

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 ?

Return to “EViews 5 and Earlier”

Who is online

Users browsing this forum: No registered users and 1 guest