Page 1 of 1

Dummies for day of the week, month and year

Posted: Tue Jan 22, 2019 12:02 pm
by AfonsoRod
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.

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

Posted: Tue Jan 22, 2019 12:15 pm
by EViews Gareth
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

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

Posted: Tue Jan 22, 2019 12:46 pm
by AfonsoRod
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

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

Posted: Tue Jan 22, 2019 12:59 pm
by EViews Gareth
You can't give a series a name starting with a number. Call it Y2009 instead.

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

Posted: Tue Jan 22, 2019 1:00 pm
by EViews Gareth
Although, I'll reiterate, there should be no reason to create these series at all.

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

Posted: Wed Jan 23, 2019 3:57 am
by AfonsoRod
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.

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

Posted: Wed Jan 23, 2019 6:31 am
by EViews Gareth
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.