Page 1 of 1

Dummy Variable for different days of the year

Posted: Thu Jul 25, 2013 4:06 am
by martin1990
Hello,

I am quite new to eviews and am having some trouble creating the necessary dummy variables for my regression. I have time series data on returns from 1980 to 2013. I need to create a dummy variable that takes on the value of 1 between september 21 and December 20 for each year in the series, and 0 otherwise.

I have tried manipulating the equation below to incorporate all the years in the series, but with no luck. Is there anyone out there that can help me?


series dummyfall = @recode((@date>@dateval("1980/21/08") and @date<@dateval("1980/20/12")),1, 0)

Thanks in advance,

Martin

Re: Dummy Variable for different days of the year

Posted: Thu Jul 25, 2013 7:20 am
by trubador

Code: Select all

series dummyfall = (@month=8 and @day>21) + (@month>8 and @month<12) + (@month=12 and @day<20)

Re: Dummy Variable for different days of the year

Posted: Thu Jul 25, 2013 8:11 am
by EViews Gareth