Creating Dummies for calendar effects

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

Sissy
Posts: 30
Joined: Thu Apr 19, 2012 1:59 am

Creating Dummies for calendar effects

Postby Sissy » Mon Apr 23, 2012 11:47 pm

Hello,

I have daily database (spot prices) in my workfile and I would like to create a dummy variable for the end of week and another one for the end of the month. How can I do that in Eviews 7 sv, please ?

Thanks.

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: Creating Dummies for calendar effects

Postby EViews Esther » Tue Apr 24, 2012 9:05 am

One simple solution to your problem could be the followings.

Code: Select all

series dummy1 = @recode(@weekday=7,1,0) '=1 if Sundays, =0 otherwise series temp = @recode(@day=1,1,0) series dummy2 = temp(+1) '=1 if the end of the month, =0 otherwise d(noerr) temp

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: Creating Dummies for calendar effects

Postby EViews Esther » Tue Apr 24, 2012 9:48 am

Or, more simply

Code: Select all

Series dummy1 = @weekday=7 Series dummy2 = @day(+1)=1

Sissy
Posts: 30
Joined: Thu Apr 19, 2012 1:59 am

Re: Creating Dummies for calendar effects

Postby Sissy » Tue Apr 24, 2012 9:52 am

It works, great ! Thanks a lot. :D


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests