Page 1 of 1

Sample starting from last non-missing observation

Posted: Mon Mar 28, 2011 9:37 am
by bjohn
I have a dated, quaterly workfile. I want to use the "smpl" command to make my sample start at the last non-missing observation of a variable x.

Using @ilast(x) gives me the observation ID, rather than the date of the observation. Typing "smpl @ilast(x) @end" therefore yields an "illegal date" error message.

Is there a simple way to tell eviews to begin the sample at the last known value of variable x?

Re: Sample starting from last non-missing observation

Posted: Mon Mar 28, 2011 9:41 am
by EViews Gareth
You can use @otod to convert the observation ID into a date string. You can then put that string into the sample statement.

Re: Sample starting from last non-missing observation

Posted: Mon Mar 28, 2011 9:46 am
by bjohn
If I type smpl @otod(@ilast(x)) 2010Q4, I still get the illegal date message!

Re: Sample starting from last non-missing observation

Posted: Mon Mar 28, 2011 9:52 am
by EViews Gareth

Code: Select all

%start = @otod(@ilast(x)) smpl {%start} 2010q4