Retrieve Date String from Dummy Variables & Make Trend

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

Benja
Posts: 2
Joined: Thu Jun 30, 2016 6:39 am

Retrieve Date String from Dummy Variables & Make Trend

Postby Benja » Thu Jun 30, 2016 6:46 am

Hello,

I use irregular daily data and have a large list of "blip" i.e. 0001000 dummy variables.
I have two questions:
1. How can I retrieve the date when such a dummy variable is 1.
2. How can I create a trend (shift) variable such that for the "blip" dummy 0001000 I obtain a trend shift variable "0001234"


Thank you and best regards

Benja
(I use Eviews 8 )

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

Re: Retrieve Date String from Dummy Variables & Make Trend

Postby EViews Gareth » Thu Jun 30, 2016 7:46 am

Find the date:

Code: Select all

smpl if dum1 = 1 string mydate = @otods(1)
Make the trend shift:

Code: Select all

smpl {mydate} @last series dum2 = @trend - @dtoo(mydate)

Benja
Posts: 2
Joined: Thu Jun 30, 2016 6:39 am

Re: Retrieve Date String from Dummy Variables & Make Trend

Postby Benja » Fri Jul 01, 2016 12:46 am

Thank you for the fast response. Unfortunately the last line returns this error message : "@DTOO is not a Genr or series expression function in "SERIES DUM2 = @TREND - @DTOO(MYDATE)"". I am not sure what to make of it. Maybe the date format is not appropriate? My date-variable "date" is formated like this:

1/02/2008 2008-01-02
1/03/2008 2008-01-03
1/04/2008 2008-01-04
1/07/2008 2008-01-07
1/08/2008 2008-01-08

Accordingly, the string variable mydate contains e.g. 5/01/2008 for my first blip dummy.



Thanks for helping!

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

Re: Retrieve Date String from Dummy Variables & Make Trend

Postby EViews Gareth » Fri Jul 01, 2016 8:17 am

Code: Select all

!val = @dtoo(mydate) series dum2 = @trend-!val


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests