Page 1 of 1
weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 2:14 am
by clubmed
hi
i want to estimate effect of weekly in my data (frequency weekly). by this code "series d1= @day=@minsby(@day,@datefloor(@date, "m"))" it generate dummy for the first week of every month. how can modify the code to make dummy like this:
1-generate dummy for the first and second week for every month
2-generate dymmy just for the second week for every month.
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 6:26 am
by EViews Gareth
How are you defining the first and second week of the month?
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 7:14 am
by clubmed
first Sat 08/02/1991 and the second Fri 15/02/1991
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 7:15 am
by EViews Gareth
I don't understand that.
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 7:18 am
by clubmed
sorry,
i have not the first week for the first month for my data because it start by the second week 08/02/1991 for the Feb month, but the others month start by the first week.
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 7:57 am
by EViews Gareth
That still doesn't make sense. What is the first week of a month? The first week in which any day of the week occurs within the month? The first week in which the Monday is in the month? The first week in which the Sunday is in the week? etc...
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 8:16 am
by clubmed
Friday

, how can generate dummy for my two case
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 8:30 am
by EViews Gareth
In your workfile's case it is easy:
Code: Select all
(@month<>@month(-1) or @month<>@month(-2))
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 9:07 am
by clubmed
but when i use this code
first case: first & second week take 1 for every month
Code: Select all
series d1= @recode((@month<>@month(-1) or @month<>@month(-2)),1,0) the 08/02/1991 should take 1 not "na" value
second case: second week take 1 for every month
Code: Select all
series d1= @recode(@month(-1)<>@month(-2),1,0) the 08/02/1991 should take 1 not "na" value
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 9:16 am
by EViews Gareth
I'm sure you can figure out how to fix the first observations.
Re: weekly dummy for 1st&2nd
Posted: Fri Apr 29, 2016 9:20 am
by clubmed
Got it!, Edit
thank you very much for your help :)