Fall Dummy variable for SAD hypothesis

For econometric discussions not necessarily related to EViews.

Moderators: EViews Gareth, EViews Moderator

hmurphy94
Posts: 2
Joined: Tue Aug 08, 2017 10:28 am

Fall Dummy variable for SAD hypothesis

Postby hmurphy94 » Fri Aug 11, 2017 4:58 am

hi

i have daily data to test the see composite index. i want to create a dummy variable that equals 1 between 21st of september and 20th december, and one that equals 1 between 21st december and 20th march for all years. however, i seem to be only able to create it for one year of the sample using

series dummy4 = @recode(@date>@dateval("1991/09/21") and @date<@dateval("1991/12/20"), 1, 0)

i tried dropping the 1991 in the hope it would work for all years but it either comes up 0 for every figure or else n/a. the data sample is 1991/1/07 to 2016/1/08. thanks!

EViews Matt
EViews Developer
Posts: 133
Joined: Thu Apr 25, 2013 7:48 pm

Re: Fall Dummy variable for SAD hypothesis

Postby EViews Matt » Fri Aug 11, 2017 8:57 am

Hello,

There are several ways to do what you want, here are two. I've removed the unnecessary @recode.

Code: Select all

series dummy4 = @date > @dateval(@str(@datepart(@date, "YY")) + "/09/21") and @date < @dateval(@str(@datepart(@date, "YY")) + "/12/20")

or

Code: Select all

series dummy4 = (@month = 9 and @day > 21 or @month > 9) and (@month = 12 and @day < 20 or @month < 12)


Return to “Econometric Discussions”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest