Dummies for day of the week, month and 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

AfonsoRod
Posts: 43
Joined: Wed May 31, 2017 7:37 am

Dummies for day of the week, month and year

Postby AfonsoRod » Tue Jan 22, 2019 12:02 pm

Dear all

I have a hourly data covering the period of 01/jan/2009 to 31/dec/2018, and I want to create dummies for each day of the week, each month and each year.
For the day of the week and month dummies I have conducted the following codes with success:

Code: Select all

genr january=@month=1

Code: Select all

genr monday=@weekday=1


My problem is that I can't do the same thing for years.
Does anyone know how can it be done?

I thank you all in advance.

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

Re: Dummies for day of the week, month and year

Postby EViews Gareth » Tue Jan 22, 2019 12:15 pm

Why can you not do the same thing for years using @year?

Also, you should try using @expand(@month) etc... to automatically impose the dummies rather than creating them manually.
http://www.eviews.com/Learning/dummies.html
Follow us on Twitter @IHSEViews

AfonsoRod
Posts: 43
Joined: Wed May 31, 2017 7:37 am

Re: Dummies for day of the week, month and year

Postby AfonsoRod » Tue Jan 22, 2019 12:46 pm

If I use the same thing for years i get this error message "(1) is not a valid index for."

The code I used was:

Code: Select all

genr 2009=@year=2009

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

Re: Dummies for day of the week, month and year

Postby EViews Gareth » Tue Jan 22, 2019 12:59 pm

You can't give a series a name starting with a number. Call it Y2009 instead.
Follow us on Twitter @IHSEViews

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

Re: Dummies for day of the week, month and year

Postby EViews Gareth » Tue Jan 22, 2019 1:00 pm

Although, I'll reiterate, there should be no reason to create these series at all.
Follow us on Twitter @IHSEViews

AfonsoRod
Posts: 43
Joined: Wed May 31, 2017 7:37 am

Re: Dummies for day of the week, month and year

Postby AfonsoRod » Wed Jan 23, 2019 3:57 am

EViews Gareth wrote:You can't give a series a name starting with a number. Call it Y2009 instead.


Thank you, that worked.

Regarding the "no reason to do this", if the day of the week, month or year can make variables to have a different behavior towards the dependent variable, isn't it a reason to this kind of dummies? For example, a variable "A" can have a positive high level of significance explaining the dependent variable "Y" in august, while being completely insignificant explaining the same variable in February. I'm sorry if my doubt is somehow dumb, but I'm kind of a rookie at econometrics.

Once again, thank you for the help.

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

Re: Dummies for day of the week, month and year

Postby EViews Gareth » Wed Jan 23, 2019 6:31 am

The idea behind using dummy variables is fine, my point was that in EViews you don’t need to create them as series first, you can just estimate with the expressions in the equation directly.
Follow us on Twitter @IHSEViews


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 14 guests