String with first and last observation?

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

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

tvonbrasch
Posts: 540
Joined: Fri Apr 15, 2011 5:35 am

String with first and last observation?

Postby tvonbrasch » Fri Dec 02, 2016 12:59 am

Hi

I want to make an annual workpage starting in the first year of the quarterly workpage and ending in the last year of the same quarterly workpage.

The following code works:

Code: Select all

   genr _auxyear=@year 'lager hjelpeserie
   %first = @left(_auxyear.@first,4)
   %last = @left(_auxyear.@last,4)
   pagecreate(page=a) a {%first} {%last}


but is not efficient. How can this be done in a better way (without creating the auxiliary series)?
Thomas

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

Re: String with first and last observation?

Postby EViews Gareth » Fri Dec 02, 2016 5:59 am

You can create an annual page specifying the dates including quarters, so, if you can do something as simple as:

Code: Select all

smpl @all
%dates = @pagesmpl
pagecreate a {%dates}
Follow us on Twitter @IHSEViews

tvonbrasch
Posts: 540
Joined: Fri Apr 15, 2011 5:35 am

Re: String with first and last observation?

Postby tvonbrasch » Sat Dec 03, 2016 11:20 am

Perfect, thank you Gareth!
Thomas


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 19 guests