Page 1 of 1

sample range dependent on the time series

Posted: Wed Mar 24, 2010 10:32 am
by Krzysztof
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

Re: sample range dependent on the time series

Posted: Wed Mar 24, 2010 10:39 am
by EViews Gareth
Aren't you just saying you want:

Code: Select all

smpl if X<>na

Re: sample range dependent on the time series

Posted: Thu Mar 25, 2010 12:57 am
by Krzysztof
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

Re: sample range dependent on the time series

Posted: Thu Mar 25, 2010 8:08 am
by EViews Gareth

Code: Select all

smpl if x <> na series smplser=1 smpl if @cumsum(smplser)>2 and x <> na