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

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

ylongchamp
Posts: 14
Joined: Fri Apr 08, 2011 5:03 am

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

Postby ylongchamp » Tue Nov 20, 2012 3:47 am

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

ylongchamp
Posts: 14
Joined: Fri Apr 08, 2011 5:03 am

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

Postby ylongchamp » Tue Nov 20, 2012 6:14 am

Notice that @month and @year are also wrong!

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

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

Postby EViews Gareth » Tue Nov 20, 2012 8:46 am

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.

ylongchamp
Posts: 14
Joined: Fri Apr 08, 2011 5:03 am

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

Postby ylongchamp » Tue Nov 20, 2012 10:22 am

My mistake! thank you.

best regards,
yves


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests