Page 1 of 1

Seasonal dummy variables

Posted: Sat Oct 11, 2008 11:37 am
by adaghayere
I know that I can create seasonal dummy variables such as

genr jan=@seas(1)
genr feb=@seas(2)

and so forth...if I am working with monthly data.... how can I create a dummy variable for indicating years in which presidential elections take place? Since this is once every 4 years and jan once every 4 years is fine....how do I do it?

I tried...

genr preselecyr=@seas(48) and I get that ugly singular matrix error.

Re: Seasonal dummy variables

Posted: Sat Oct 11, 2008 11:43 am
by EViews Gareth
You cannot use @seas to do this, since @seas only works within 1 year periods (i.e. so the option you can enter on a monthly workfile is 12, not 48).

If you would like to do it automatically rather than just manually entering 1s at the appropriate date, something along the lines of:

Code: Select all

smpl @all series dum = 0 smpl if @mod(@year,4)=0 and @month=11 dum=1 smpl @all
That will give you a dummy variable for November 2000, November 2004, etc....