sample range dependent on the time series

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

Krzysztof
Posts: 15
Joined: Mon Jan 11, 2010 3:53 am

sample range dependent on the time series

Postby Krzysztof » Wed Mar 24, 2010 10:32 am

Hi,

I am wondering whether there is any way to make the sample range dependent on the observations within a series.
To be more precise let's assume the following situation.
I have a sheet with annual frequency and 1990 - 2010 sample. There is also a time series in this sheet with numerical values for 1995-2005 and NA values for the remaining time references.
How can I set up a sample range so that it is only as of the first non-missing observation in the series/ second non-missing observation/ the last non missing observation?

I would appreciate the help very much.

Best, k

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

Re: sample range dependent on the time series

Postby EViews Gareth » Wed Mar 24, 2010 10:39 am

Aren't you just saying you want:

Code: Select all

smpl if X<>na
Follow us on Twitter @IHSEViews

Krzysztof
Posts: 15
Joined: Mon Jan 11, 2010 3:53 am

Re: sample range dependent on the time series

Postby Krzysztof » Thu Mar 25, 2010 12:57 am

This looks good and it definately solves part of my problems.
If you could also tell me how to set up a sample range so that it starts from second non-missing observation that would be really fantastic :D

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

Re: sample range dependent on the time series

Postby EViews Gareth » Thu Mar 25, 2010 8:08 am

Code: Select all

smpl if x <> na
series smplser=1
smpl if @cumsum(smplser)>2 and x <> na
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 18 guests