Page 1 of 1

@day() and @weekday() return wrong data

Posted: Tue Nov 20, 2012 3:47 am
by ylongchamp
Dear eviews,

I currently use eviews 7 (Jul 20 2012 build) and think there are two bugs.

When I run the code as follows

Code: Select all

workfile wk_test d7 1970 2012 smpl 1970 2012 pagecreate(page="DAY") d7 1970 2012 genr one = 1 genr day = @day(one) genr weekday = @weekday(one)
1) "day" takes 2 for the 1st January 1970 and na on 31 December 2012!
2) "weekday" returns 7 for Staturday and 1 for Sunday, contrary to what is written in the reference books. Additionally, on 31 December 2012, the assigned value is na.

Thank you in advance for your help.

Best regards,
Yves

Re: @day() and @weekday() return wrong data

Posted: Tue Nov 20, 2012 6:14 am
by ylongchamp
Notice that @month and @year are also wrong!

Re: @day() and @weekday() return wrong data

Posted: Tue Nov 20, 2012 8:46 am
by EViews Gareth
I think you mis-undertand what you're doing.

From the manual:

@day: returns the day of the month in which the current observation begins.

So it will be equal to "1" on the first day of the month, "2" on the second day of the month etc....

Note that it does not require parenthesis, and it takes no arguments/options. It is treated like any other variable name.

When you append a "(1)" to it, you're telling EViews you want a one period lead on the variable.

Re: @day() and @weekday() return wrong data

Posted: Tue Nov 20, 2012 10:22 am
by ylongchamp
My mistake! thank you.

best regards,
yves