Seasonal dummy variables

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

adaghayere
Posts: 1
Joined: Sat Oct 11, 2008 11:24 am

Seasonal dummy variables

Postby adaghayere » Sat Oct 11, 2008 11:37 am

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.

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

Re: Seasonal dummy variables

Postby EViews Gareth » Sat Oct 11, 2008 11:43 am

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....
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 23 guests