Page 1 of 1

A simple problem with a subroutine

Posted: Tue Jul 01, 2014 6:35 am
by epeter
Hi eveyone,

I apologize in advance for my poor english!
I have a little problem with a subroutine, and i'll be grateful if you could help me.
While writing this simple subroutine, i always get the message "N is not defined or is an illegal command in N=@obs(series x)".
Since I'm new to EViews, i guess the problem could be fixed very briefly by one of you.

Here is the code i wrote

Code: Select all

subroutine local sub (series x, scalar y) n =@obs(series x) banda sup 1,96*1/sqrt(n) banda inf= -1,96*1/sqrt(n) !contatore= 0 for !i=1 to 10 scalar c = @cor(x), x(-!i) if c< banda inf and c> banda sup !contatore= !contatore + 1 endif next scalar y= contatore/10 endsub
With writing n=@obs(series x), i just want it to take into account that the number of observations of my series change.

Thanks in advance to all of you!

Re: A simple problem with a subroutine

Posted: Tue Jul 01, 2014 9:10 am
by EViews Gareth
Use !N rather than N

Re: A simple problem with a subroutine

Posted: Mon Jul 07, 2014 2:08 am
by epeter
Thank you!