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.
Seasonal dummy variables
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Seasonal dummy variables
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:
That will give you a dummy variable for November 2000, November 2004, etc....
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
Who is online
Users browsing this forum: No registered users and 23 guests