Page 1 of 1

Retrieve Date String from Dummy Variables & Make Trend

Posted: Thu Jun 30, 2016 6:46 am
by Benja
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 )

Re: Retrieve Date String from Dummy Variables & Make Trend

Posted: Thu Jun 30, 2016 7:46 am
by EViews Gareth
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)

Re: Retrieve Date String from Dummy Variables & Make Trend

Posted: Fri Jul 01, 2016 12:46 am
by Benja
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!

Re: Retrieve Date String from Dummy Variables & Make Trend

Posted: Fri Jul 01, 2016 8:17 am
by EViews Gareth

Code: Select all

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