Due Dates on Weekends
Posted: Tue Feb 28, 2017 6:49 pm
Hi, I am new to eviews and am trying to write some code that will set a variable equal to 1 if the date on the 20th of the month is a business day. If it is not a business day then the variable should be equal to 1 on the next business day.
I have written some code which is not quite doing what I would like. I am sure there is also a more efficient way to do this, any help is appreciated. The series is daily 7 day week.
series day_of_week=@weekday
smpl if (day_of_week<6)
series t= @recode(@day=20, 1, 0)
smpl if (day_of_week=6 and @day=20)
series t_sat = @recode(@day=20, 1, 0)
smpl @all
series t_sat =@recode(t_sat=na,0,1)
if t_sat=1 then series t= @recode(@day=22, 1, 0)
endif
smpl if (day_of_week=7 and @day=20)
series t_sun = @recode(@day=20, 1, 0)
smpl @all
series t_sun =@recode(t_sun=na,0,1)
if t_sun=1 then series t= @recode(@day=21, 1, 0)
endif
I have written some code which is not quite doing what I would like. I am sure there is also a more efficient way to do this, any help is appreciated. The series is daily 7 day week.
series day_of_week=@weekday
smpl if (day_of_week<6)
series t= @recode(@day=20, 1, 0)
smpl if (day_of_week=6 and @day=20)
series t_sat = @recode(@day=20, 1, 0)
smpl @all
series t_sat =@recode(t_sat=na,0,1)
if t_sat=1 then series t= @recode(@day=22, 1, 0)
endif
smpl if (day_of_week=7 and @day=20)
series t_sun = @recode(@day=20, 1, 0)
smpl @all
series t_sun =@recode(t_sun=na,0,1)
if t_sun=1 then series t= @recode(@day=21, 1, 0)
endif