hi,
currently i'm making data stream to identify turn of the week effect.
I need to make dummy for the end of the week of trading day, which usually is on Friday, but sometimes if there is a holiday it might be on Thursday.so how do i make the dummy?
the data is like this
1/01/1981 0.02541978146372411
1/02/1981 0.02541978146372411
1/05/1981 1.09817980020208
1/06/1981 0.02541978146372411
1/07/1981 0.02541978146372411
1/08/1981 0.02541978146372411
1/09/1981 0.02541978146372411
1/12/1981 1.09817980020208
1/13/1981 0.02541978146372411
1/14/1981 0.02541978146372411
1/15/1981 0.02541978146372411
1/16/1981 0.02541978146372411
and i also need to make an average for each week can i do it with eviews?
thank you so much. :D :D
turn of the week
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: turn of the week
Need a few more details to be of concrete help, but assuming you have an irregular daily workfile, this will generate the dummy:
And this will generate the averages:
where X is the series for which you wish to generate the averages.
Code: Select all
series dum1 = @date=@maxsby(@date, @datefloor(@date,"w"))
Code: Select all
series av1 = @meansby(X, @week)
Re: turn of the week
why we need irregular daily workfile? because when i tried to do that 1 observation should be deleted, is it possible not to use irregular workfile?
series av1 = @meansby(X, @week)
when i use it,it said that @week is not a Genr or series expression function in "@week"
what's wrong with this command?
and i need to compare the result of the average for each week with the next monday data. how can i do that?
thanks for your fast replied.. :D :D
series av1 = @meansby(X, @week)
when i use it,it said that @week is not a Genr or series expression function in "@week"
what's wrong with this command?
and i need to compare the result of the average for each week with the next monday data. how can i do that?
thanks for your fast replied.. :D :D
Re: turn of the week
also i want to ask, how i make the dummy if what i want is monday not friday? thanks..
sorry i'm asking to many questions..
sorry i'm asking to many questions..
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: turn of the week
Perhaps you should provide more details as to the structure of your data. You don't need an irregular daily file, but since you haven't told us what structure your file is, I had to make an assumption.
Re: turn of the week
the structure is daily 5 day week..
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: turn of the week
Code: Select all
series dum = @date = @maxsby(@recode(x<>na, @date, na), @datefloor(@date,"w"))
series avg = @meansby(x, @datefloor(@date, "ww"))
Re: turn of the week
i still cannot make the average..the result is like this..
0.02541978146372411
0.02541978146372411
0.02541978146372411
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
until the end of the data..
did i make a mistake?
and the dummy is still for friday, how can i change it to monday?
thanks.
0.02541978146372411
0.02541978146372411
0.02541978146372411
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
0.2399717852113952
until the end of the data..
did i make a mistake?
and the dummy is still for friday, how can i change it to monday?
thanks.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: turn of the week
Change @maxsby to @minsby to get Monday.
Re: turn of the week
yeah..it's work now..but there is one Friday that have the value of dummy 1.. i don't know why..
what about for the average? thanks.. :D :D
what about for the average? thanks.. :D :D
Who is online
Users browsing this forum: No registered users and 2 guests
