build a list of series which fits a criteria

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

organic
Posts: 6
Joined: Thu Apr 24, 2014 12:23 pm

build a list of series which fits a criteria

Postby organic » Thu Apr 24, 2014 12:36 pm

HI guys,

I am using Eviews 7.2

suppose I have three time series, I would like to get a list of series which have more than 10 in any given year, maybe in the form of a string object.

how would I go about doing it ?

for example:
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011
series A 4 9 8 7 3 7 1 2 5 8 7 3
Series B 2 10 8 11 10 5 9 11 9 5 8 9
Series C 1 9 7 6 8 9 2 1 5 4 11 4

I should get series B and C in my list.

I think it should really straight forward but I have had a hard time coming up with a solution.
any help would be appreciated.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: build a list of series which fits a criteria

Postby EViews Gareth » Thu Apr 24, 2014 5:11 pm

I'm not sure what you're asking. It isn't clear how B and C get into your list. As far as I can see, there isn't a single year in which they both have a value greater than 10. Perhaps you mean they have 10 observations?

organic
Posts: 6
Joined: Thu Apr 24, 2014 12:23 pm

Re: build a list of series which fits a criteria

Postby organic » Fri Apr 25, 2014 2:25 am

hi Gareth,

series A, B and C are three time series between year 2000 and 2011. i would like to include any series which have greater than 10 in numeric value into a list so i can undergo further data manipulation.
in the example below, i can see

series B is greater 10 in the year 2003 and 2007
series C is greater than 10 in the year 2010

series 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011
series A 4 9 8 7 3 7 1 2 5 8 7 3
Series B 2 10 8 11 10 5 9 11 9 5 8 9
Series C 1 9 7 6 8 9 2 1 5 4 11 4

Many thanks,

organic
Posts: 6
Joined: Thu Apr 24, 2014 12:23 pm

Re: build a list of series which fits a criteria

Postby organic » Fri Apr 25, 2014 2:34 am

hi Gareth ,

i can see how confusion may arise, i cannot get the data to line up properly, the top row is suppose to be year.

please refer to the attached excel file for the time series.
Attachments
example .xlsx
(8.82 KiB) Downloaded 270 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: build a list of series which fits a criteria

Postby EViews Gareth » Fri Apr 25, 2014 6:27 am

Ah, my confusion was from your use of "greater than 10 in any given year". I think you want "greater than 10 in any year". Or, really, you just want to check whether the maximum of the series is greater than 10.

Code: Select all

%baselist = "a b cc dd ee ff" %result = "" for %j {%baselist} if @max({%j})>10 then %result = %result + " " + %j endif next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests