Page 1 of 1

SIMILAR FORMULA OF @FIRSTSBY() FOR ALPHA SERIES?

Posted: Tue Sep 05, 2017 4:39 pm
by bcchen
Hi Guys,

I want to get the first observation of a alpha series(alpha1) each time another two series's value changes (alpha2 and series3).
I know we have @fistsby for numeric series, is there any formula (or formula communication) that I could do something like:

alpha alpha1_new=@firstsby(alpha1, alpha2, series3)?

Please advise!

Best,
BC

Re: SIMILAR FORMULA OF @FIRSTSBY() FOR ALPHA SERIES?

Posted: Wed Sep 06, 2017 9:44 am
by EViews Matt
Hello,

I believe you'll have to use an explicit loop, e.g.:

Code: Select all

series tmp = @firstsby(@obsnum, alpha2, series3) alpha alpha1_new for !i = 1 to @obsrange alpha1_new(!i) = alpha1(tmp(!i)) next delete tmp

Re: SIMILAR FORMULA OF @FIRSTSBY() FOR ALPHA SERIES?

Posted: Thu Sep 14, 2017 5:46 pm
by bcchen
Thank you Matt.
Hope there will be an @firstby() for alpha series soon.

Best,
BC