Page 1 of 1

turn of the week

Posted: Wed Mar 13, 2013 1:53 pm
by erlin
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

Re: turn of the week

Posted: Wed Mar 13, 2013 3:51 pm
by EViews Gareth
Need a few more details to be of concrete help, but assuming you have an irregular daily workfile, this will generate the dummy:

Code: Select all

series dum1 = @date=@maxsby(@date, @datefloor(@date,"w"))
And this will generate the averages:

Code: Select all

series av1 = @meansby(X, @week)
where X is the series for which you wish to generate the averages.

Re: turn of the week

Posted: Thu Mar 14, 2013 1:38 am
by erlin
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

Re: turn of the week

Posted: Thu Mar 14, 2013 3:56 am
by erlin
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..

Re: turn of the week

Posted: Thu Mar 14, 2013 7:47 am
by EViews Gareth
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

Posted: Thu Mar 14, 2013 9:19 am
by erlin
the structure is daily 5 day week..

Re: turn of the week

Posted: Thu Mar 14, 2013 9:38 am
by EViews Gareth

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

Posted: Thu Mar 14, 2013 11:36 am
by erlin
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.

Re: turn of the week

Posted: Thu Mar 14, 2013 11:42 am
by EViews Gareth
Change @maxsby to @minsby to get Monday.

Re: turn of the week

Posted: Thu Mar 14, 2013 11:57 am
by erlin
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