turn of the week

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

erlin
Posts: 12
Joined: Wed Mar 13, 2013 1:44 pm

turn of the week

Postby erlin » Wed Mar 13, 2013 1:53 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: turn of the week

Postby EViews Gareth » Wed Mar 13, 2013 3:51 pm

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.

erlin
Posts: 12
Joined: Wed Mar 13, 2013 1:44 pm

Re: turn of the week

Postby erlin » Thu Mar 14, 2013 1:38 am

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

erlin
Posts: 12
Joined: Wed Mar 13, 2013 1:44 pm

Re: turn of the week

Postby erlin » Thu Mar 14, 2013 3:56 am

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..

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: turn of the week

Postby EViews Gareth » Thu Mar 14, 2013 7:47 am

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.

erlin
Posts: 12
Joined: Wed Mar 13, 2013 1:44 pm

Re: turn of the week

Postby erlin » Thu Mar 14, 2013 9:19 am

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

Postby EViews Gareth » Thu Mar 14, 2013 9:38 am

Code: Select all

series dum = @date = @maxsby(@recode(x<>na, @date, na), @datefloor(@date,"w")) series avg = @meansby(x, @datefloor(@date, "ww"))

erlin
Posts: 12
Joined: Wed Mar 13, 2013 1:44 pm

Re: turn of the week

Postby erlin » Thu Mar 14, 2013 11:36 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: turn of the week

Postby EViews Gareth » Thu Mar 14, 2013 11:42 am

Change @maxsby to @minsby to get Monday.

erlin
Posts: 12
Joined: Wed Mar 13, 2013 1:44 pm

Re: turn of the week

Postby erlin » Thu Mar 14, 2013 11:57 am

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests