SIMILAR FORMULA OF @FIRSTSBY() FOR ALPHA SERIES?

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Jason, EViews Moderator, EViews Pamela

bcchen
Posts: 22
Joined: Tue May 02, 2017 8:34 am

SIMILAR FORMULA OF @FIRSTSBY() FOR ALPHA SERIES?

Postby bcchen » Tue Sep 05, 2017 4:39 pm

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

EViews Matt
EViews Developer
Posts: 154
Joined: Thu Apr 25, 2013 7:48 pm

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

Postby EViews Matt » Wed Sep 06, 2017 9:44 am

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

bcchen
Posts: 22
Joined: Tue May 02, 2017 8:34 am

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

Postby bcchen » Thu Sep 14, 2017 5:46 pm

Thank you Matt.
Hope there will be an @firstby() for alpha series soon.

Best,
BC


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 7 guests