Page 1 of 1

Looping with IF function

Posted: Tue Nov 19, 2013 9:11 am
by rmoralesaramburu
Hello,

I have the following problem. I have more than 45 series and I would like to program the following:

For %y 1-45 '(I don't know if that's possible)
IF nameseries_{%y}>=0.50 then
'count observations before founding >=0.50 condition and put it on a scalar.
else
'nothing
next


So, I don't know how to program it, but I hope you could understand what I am trying to do.

Thank you!!!!

Re: Looping with IF function

Posted: Tue Nov 19, 2013 9:14 am
by EViews Gareth
I hope you could understand what I am trying to do.
Unfortunately not.

Re: Looping with IF function

Posted: Tue Nov 19, 2013 9:32 am
by rmoralesaramburu
Thanks, I figure it out with this:

Code: Select all

matrix(47,1) months_to_hike for !i = 1 to 47 smpl if fwd2013_!i<=0.5 matrix months_to_hike(!i,1)=@obs( fwd2013_!i) next