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.
weekly dummy for 1st&2nd
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: weekly dummy for 1st&2nd
How are you defining the first and second week of the month?
Re: weekly dummy for 1st&2nd
first Sat 08/02/1991 and the second Fri 15/02/1991
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: weekly dummy for 1st&2nd
I don't understand that.
Re: weekly dummy for 1st&2nd
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.
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.
- Attachments
-
- wgfupus2w.wf1
- (35.77 KiB) Downloaded 389 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: weekly dummy for 1st&2nd
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
Friday
, how can generate dummy for my two case
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: weekly dummy for 1st&2nd
In your workfile's case it is easy:
Code: Select all
(@month<>@month(-1) or @month<>@month(-2))
Re: weekly dummy for 1st&2nd
but when i use this code
first case: first & second week take 1 for every month the 08/02/1991 should take 1 not "na" value
second case: second week take 1 for every month the 08/02/1991 should take 1 not "na" value
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)second case: second week take 1 for every month
Code: Select all
series d1= @recode(@month(-1)<>@month(-2),1,0)-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: weekly dummy for 1st&2nd
I'm sure you can figure out how to fix the first observations.
Re: weekly dummy for 1st&2nd
Got it!, Edit
thank you very much for your help :)
thank you very much for your help :)
Who is online
Users browsing this forum: No registered users and 2 guests
