time (trend) for daily custom week 6 day per week
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
time (trend) for daily custom week 6 day per week
i have 3 problem case:
the first: frequency daily (from 2001 to 2005) custom week 6 day per week (Days: 6-Sat; 4-Thu)
i have data representaion with frequency daily (from 2001 to 2005) custom week 5 day per week (Days: 6-Sat; 4-Thu), when i use the code series timeyear=@datepart(@date, "ddd") i get trend for every year that what i need :D , but the problem it generate 365 or 366 days for every year, but some years have 314 days and some years have 313 days in my case.
i would to generate time (trend) for every year like this:
year 2001: time 1... 313
year 2002: time 1... 313
year 2003: time 1... 313
year 2004: time 1...314
......etc
the second: frequency daily (from 2001 to 2005) custom week 6 day per week (Days: 6-Sat; 4-Thu)
i have the same problem with this code when i use series timeday=@day, it generate day for every month, but some month i have 27 days and some others 25 days in month....
i would to generate time (trend) for every month in year.
01/01/2001-31/12/2001: time 1 ...27
01/02/2001-28/02/2001: time 1 ...23
....etc
the third: frequency daily (from 2001 to 2005) custom week 6 day per week (Days: 6-Sat; 4-Thu)
i have use timeweek=@weekday but not work
i would to generate time (trend) like this
01/01/2001-06/01/2001: time 1...6
07/01/2001-13/01/2001: time 1...6
14/01/2001 -20/01/2001: time 1...6
21/01/2001 - 27/01/2001: time 1...6
28/01/2001 - 31/01/2001: time 1 2 3 4 (end of month)
for the next month Feb
01/02/2001-07/02/2001: time 1...6
...... etc
any idea about this.
the first: frequency daily (from 2001 to 2005) custom week 6 day per week (Days: 6-Sat; 4-Thu)
i have data representaion with frequency daily (from 2001 to 2005) custom week 5 day per week (Days: 6-Sat; 4-Thu), when i use the code series timeyear=@datepart(@date, "ddd") i get trend for every year that what i need :D , but the problem it generate 365 or 366 days for every year, but some years have 314 days and some years have 313 days in my case.
i would to generate time (trend) for every year like this:
year 2001: time 1... 313
year 2002: time 1... 313
year 2003: time 1... 313
year 2004: time 1...314
......etc
the second: frequency daily (from 2001 to 2005) custom week 6 day per week (Days: 6-Sat; 4-Thu)
i have the same problem with this code when i use series timeday=@day, it generate day for every month, but some month i have 27 days and some others 25 days in month....
i would to generate time (trend) for every month in year.
01/01/2001-31/12/2001: time 1 ...27
01/02/2001-28/02/2001: time 1 ...23
....etc
the third: frequency daily (from 2001 to 2005) custom week 6 day per week (Days: 6-Sat; 4-Thu)
i have use timeweek=@weekday but not work
i would to generate time (trend) like this
01/01/2001-06/01/2001: time 1...6
07/01/2001-13/01/2001: time 1...6
14/01/2001 -20/01/2001: time 1...6
21/01/2001 - 27/01/2001: time 1...6
28/01/2001 - 31/01/2001: time 1 2 3 4 (end of month)
for the next month Feb
01/02/2001-07/02/2001: time 1...6
...... etc
any idea about this.
Last edited by clubmed on Mon Apr 25, 2016 9:48 am, edited 2 times in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
time (trend) for daily custom week 5 day per week
I'm on my phone so can't give precise code, but the basic idea is that you would use a @recode with a condition testing whether the day of the year is equal to 1 or not. If it is equal to 1, return 0, otherwise return previous value plus 1.
Something like:
Same logic can be applied to others
Something like:
Code: Select all
Series timeyear = @datepart(@date,"ddd")=1,0,timeyear(-1)+1)
Re: time (trend) for daily custom week 6 day per week
the code for timeyear work perfectly
the two code: for day and weekday not work because i have some month start by number 02 (example: 02/06/2001 and 02/02/2002, 02/03/2002,......etc); so if my data for example start by 02/01/2001 or 04/01/2001 i can not applied all the codes for my three case.
Code: Select all
series timeyear = @recode(@datepart(@date,"ddd")=1,0,timeyear(-1)+1)Code: Select all
series timeday = @recode(@day=1,0,timeday(-1)+1)
series timewday = @recode(@weekday=1,0,timewday(-1)+1)- Attachments
-
- daily6.wf1
- (34.39 KiB) Downloaded 419 times
Last edited by clubmed on Mon Apr 25, 2016 9:47 am, edited 1 time in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: time (trend) for daily custom week 5 day per week
Try using @month<>@month(-1) as the condition
Re: time (trend) for daily custom week 6 day per week
this code work for day:
for weekday i have no idea?
Code: Select all
series timeday = @recode(@month<>@month(-1),0,timeday(-1)+1)
smpl 01/01/2001 31/01/2001
timeday = @recode(@day=1,0,timeday(-1)+1)
smpl @all
Last edited by clubmed on Mon Apr 25, 2016 9:49 am, edited 1 time in total.
Re: time (trend) for daily custom week 6 day per week
i have use this code but doesn't work for weekday
series timewday = @recode(@weekday<>@weekday(-1),0,timewday(-1)+1)
any idea about this.
series timewday = @recode(@weekday<>@weekday(-1),0,timewday(-1)+1)
any idea about this.
Re: time (trend) for daily custom week 6 day per week
probably i'm not explained very well.
i need to make time (trend) for weekday in every month
01/01/2001-07/01/2001: time 1...6
08/01/2001-14/01/2001: time 1...6
15/01/2001 -21/01/2001: time 1...6
22/01/2001 - 28/01/2001: time 1...6
29/01/2001 - 31/01/2001: time 1 2 3 (end of month)
for the next month Feb
01/02/2001-07/02/2001: time 1...6
...and so on.
i need to make time (trend) for weekday in every month
01/01/2001-07/01/2001: time 1...6
08/01/2001-14/01/2001: time 1...6
15/01/2001 -21/01/2001: time 1...6
22/01/2001 - 28/01/2001: time 1...6
29/01/2001 - 31/01/2001: time 1 2 3 (end of month)
for the next month Feb
01/02/2001-07/02/2001: time 1...6
...and so on.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: time (trend) for daily custom week 6 day per week
Try @mod(@day,7)=1 as the condition
Re: time (trend) for daily custom week 6 day per week
No, the time (trend) should stop at the end of every month and start for the next month and so on.
for example:
......
29/01/2001: time=1
30/01/2001:time= 2
31/01/2001: time=3 (end of month)
01/02/2001: time =1
for example:
......
29/01/2001: time=1
30/01/2001:time= 2
31/01/2001: time=3 (end of month)
01/02/2001: time =1
Re: time (trend) for daily custom week 6 day per week
hi,
the two code not give me what i need, the time (trend) not stop at the end of every month it continue, any help please.
series timewday = @recode(@weekday=1,0,timewday(-1)+1)
series timewday = @recode(@mod(@day,7)=1,0,timewday(-1)+1)
Best Regards.
the two code not give me what i need, the time (trend) not stop at the end of every month it continue, any help please.
series timewday = @recode(@weekday=1,0,timewday(-1)+1)
series timewday = @recode(@mod(@day,7)=1,0,timewday(-1)+1)
Best Regards.
Re: time (trend) for daily custom week 6 day per week
I tried this code but doesn't get what i need
series timewday = @recode(@weekday<=6,0,timewday(-1)+1)
any help.
series timewday = @recode(@weekday<=6,0,timewday(-1)+1)
any help.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: time (trend) for daily custom week 6 day per week
I'm failing to see what is wrong with:
Code: Select all
@recode(@mod(@day,7)=1,0,timewday(-1)+1)
Re: time (trend) for daily custom week 6 day per week
i have some month start by day number 02 (example: 02/06/2001 and 02/02/2002, 02/03/2002,......etc).
Re: time (trend) for daily custom week 6 day per week
the code work if the month start by day=1, but for day start by day=2 not work
- Attachments
-
- daily.png (32.44 KiB) Viewed 11549 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: time (trend) for daily custom week 6 day per week
series time = @recode(@month<>@month(-1), 0, @recode(time(-1)=5, 0, time(-1)+1))
Who is online
Users browsing this forum: No registered users and 2 guests
