first value

For questions regarding programming in the EViews programming language.

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

trainee
Posts: 38
Joined: Fri Jun 13, 2014 12:59 pm

first value

Postby trainee » Tue Aug 30, 2016 11:47 am

When setting sample is there a way to have the sample start when the series starts?

For instance, instead of writing "smpl 1989Q2 2016Q3" after having checked the series start date, I would like to write a code that checks the series start date itself.

Please let me know if I'm not clear.

Thanks for your help.

Trainee

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

Re: first value

Postby EViews Gareth » Tue Aug 30, 2016 11:53 am

In one line:

Code: Select all

smpl @first 2016q3 if @date >= @dateval(X.@first)
Personally I would probably do something like this though:

Code: Select all

%first = x.@first smpl {%first} 2016q3
which is a bit easier to read.

Note neither will be dynamic - the sample will not automatically adjust if the series start date changes.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests