Dummy Variable for different days of the year

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

martin1990
Posts: 1
Joined: Thu Jul 25, 2013 3:56 am

Dummy Variable for different days of the year

Postby martin1990 » Thu Jul 25, 2013 4:06 am

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

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Dummy Variable for different days of the year

Postby trubador » Thu Jul 25, 2013 7:20 am

Code: Select all

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

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

Re: Dummy Variable for different days of the year

Postby EViews Gareth » Thu Jul 25, 2013 8:11 am



Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests