Complete timeseries in group only

For questions regarding programming in the EViews programming language.

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

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Complete timeseries in group only

Postby fboehlandt » Wed Aug 01, 2012 4:08 am

Hi everyone,

I have a workfile with several timeseries of various lengths. For example, one series could have entries from 2000/07 to 2010/06, another from 1995/07 to 2005/06 and so on. I would like to create groups including timeseries with entries between two specific dates. Timeseries with fewer observations should be excluded. None of the series have any gaps.

Setting the sample to a specific start and end date does not help either, since timeseries with fewer observations are still included.

Can anyone help? A code implementation would be appreciated unless there is a way to do this using sampling

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

Complete timeseries in group only

Postby EViews Gareth » Wed Aug 01, 2012 4:40 am

I think I would add every series to a group then loop through the members one at a time and check the number of obs. If too few, drop that series.

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: Complete timeseries in group only

Postby fboehlandt » Wed Aug 01, 2012 5:51 am

Hello Gareth,
thanks for your reply. I got something like this

Code: Select all

%strg = "cfp01" !m = {%strg}.@count for !i = 1 to !m %n={%strg}.@seriesname(!i) !n = {%n}.@obs if !n < 60 then {%strg}.drop {%n} endif next
However, problem is that the number of series within the group changes dynamically (series being dropped). I need something like a do...while statement

fboehlandt
Posts: 83
Joined: Thu Apr 15, 2010 3:54 am

Re: Complete timeseries in group only

Postby fboehlandt » Wed Aug 01, 2012 6:03 am

never mind, I can do it using two groups
%str1 = "cfp01"
%str2 = "cfp02"
group {%str2}
!m = {%str1}.@count
for !i = 1 to !m
%n={%str1}.@seriesname(!i)
!n = {%n}.@obs
if !n >= 60 then
{%str2}.add {%n}
endif
next
I suppose thats the easiest way of going about it. Thanks again
cheers


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest