I am writing a short program that creates dummies for each week of the year (so, from wk1 to wk52) and it looks like the following:
if @isobject("week") = 0 then
series week = @date
endif
if @isobject("gp_weeks") = 1 then
delete gp_weeks
endif
group gp_weeks @expand(@recode(@datepart(week, "ww")=53, 1,@datepart(week, "ww")))
for !i = 1 to gp_weeks.@count
if !i < 10 then
%week = "week0" + @str(!i)
else
%week = "week" + @str(!i)
endif
%week2 = gp_weeks.@seriesname(!i)
series dum_{%week} = {%week2}
next !i
Note that there will be a week 53 for year 2007 and in the program I add 1 if it is week 53. What I usually do in Excel is to do this:
=if(weeknum($A100)=53, 1, weeknum($A100))
I compare the results from Eviews against that from Excel and found out that, starting from 1/7/2008 (week 1 according to Eviews and week 2 according to Excel), the numbers begin to diverge. Is there a way to fix this? Please let me know. Thanks.
Tchaithonv