Fetching daily series directly from datastream.

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

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

Fetching daily series directly from datastream.

Postby Liu » Fri Jun 14, 2013 6:42 am

Hi, I met a problem when I fetch a daily series directly from datastream into a EViews weekly page (@pagefreq=W).


The problem is, no matter how I adjust the starting date of the work page, Eviews gives a different set of dates for the observations, compated to
the source.

For example:

wfcreate w 1800 2014
pagecreate(page=Weekly) w 1800/02/01 2014
fetch(d=datastream, c=l) austrus

I noticed that the starting date of the work page is crucial to how Eviews is going to decide when is the end of the week, so as to decide what the last value of each week is. But no matter how I adjust the startign date of the page, the series still doesn't look the same.

The original data is like

30/05/2013 0.96615
31/05/2013 0.95725
03/06/2013 0.97725
04/06/2013 0.96505
05/06/2013 0.9544
06/06/2013 0.95935
07/06/2013 0.9495
10/06/2013 0.9464
11/06/2013 0.94265
12/06/2013 0.94815
13/06/2013 0.9639

but what's in my workfile is shifted backwards:

4/27/2013 1.0319
5/04/2013 1.00225
5/11/2013 0.97275
5/18/2013 0.96475
5/25/2013 0.95725
6/01/2013 0.9495
6/08/2013 0.9639


Is there a way I can do so that Eviews could give the correct last value of each week?

Thanks in advance.

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

Re: Fetching daily series directly from datastream.

Postby EViews Chris » Fri Jun 14, 2013 9:54 am

I'm not sure if I'm missing something, but it looks to me EViews is doing the right thing - although you may be being confused by the labeling.

For any dated workfile in EViews, each observation has a start date and an end date associated with it.

You can see these two dates by typing in the command:

show @date @enddate

In a weekly workfile, EViews uses the start day of the week as the observation label in things like the spreadsheet view. Some other packages label weeks using the end day of the week. Ther most correct label would be to show the start and end date range for every observation, but that results in really long labels. In graphs, EViews allows you to choose between using either the start or the end date of the week as the x-axis label.

Now here's your example with weekdays added:

Daily data

5/30/2013 0.96615 Thu
5/31/2013 0.95725 Fri
6/3/06/2013 0.97725 Mon
6/4/2013 0.96505 Tue
6/5/2013 0.9544 Wed
6/6/2013 0.95935 Thu
6/7/2013 0.9495 Fri
6/10/2013 0.9464 Mon
6/11/2013 0.94265 Tue
6/12/2013 0.94815 Wed
6/13/2013 0.9639 Thu

Weekly data

4/27/2013 1.0319
5/04/2013 1.00225
5/11/2013 0.97275
5/18/2013 0.96475
5/25/2013 0.95725 -> 5/25/2013 Sat to 5/31/2013 Fri
6/01/2013 0.9495 -> 6/1/2013 Sat to 6/7/2013 Fri
6/08/2013 0.9639

Each of your weeks in the weekly workfile is running Saturday to Friday, and when you bring in the daily data with the 'last' value option, the Friday value is being brought in for each week. Unless I'm missing something, this is exactly what I'd expect to happen.

By the way, in EViews v8 you can specify a weekday alignment when you create a workfile eg.

create w(mon) 1800 2014

will make a weekly workfile with each week starting on a Monday.

This is often easier than adjusting the start date to land on the desired day of the week.

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

Re: Fetching daily series directly from datastream.

Postby Liu » Fri Jun 14, 2013 11:47 am

Hi Chris, I think you pointed out an important thing I omitted.

"In a weekly workfile, EViews uses the start day of the week as the observation label in things like the spreadsheet view. "

If my understanding is correct, there are two steps during a high freq to low freq conversion using c=l option:

(1) the last value of the period becomes the observation.
(2) the first day of the period becomes the observation label.

The mismatch comes out from here.

I think right now the problem can be phrased as how I could use end day of the week as the observation label.

For example, from what you illustrated above,
5/25/2013 0.95725 -> 5/25/2013 Sat to 5/31/2013 Fri
6/01/2013 0.9495 -> 6/1/2013 Sat to 6/7/2013 Fri
6/08/2013 0.9639


I want the observation 0.9495 to be allocated to 6/7/2013 since that's how it shows in the original daily data.
The ideal one looks like this:

5/31/2013 0.95725
6/7/2013 0.9495
6/14/2013 0.9639


Thanks again Chris.

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

Re: Fetching daily series directly from datastream.

Postby EViews Chris » Thu Jun 20, 2013 5:45 pm

Hi Liu,

I'm afraid there's currently no way to get EViews to use an observation label in the spreadsheet view for weekly data other than the first day of the week. (I agree we should add this as an option in the future).

You can show another series at the same time that contains the end of period dates (using @enddate) but you can't replace the label that appears in the header.

If you really want EViews to label things that way, the only way to do it is to lie to EViews about where the weeks start and end. You'd need to first import the data following the normal EViews rules (start date is first day of the week). Then, when you're done, restructure the workfile to have dates that are incorrect in terms of the EViews rules but produce the labels that you'd like to see.

The downside is that if you then try moving data from this workfile into a different frequency workfile, EViews will follow its usual rules and get things 'incorrect'.

Note that when EViews makes a graph we do provide you with the option of labeling the observations with the end of period day.

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

Re: Fetching daily series directly from datastream.

Postby Liu » Fri Jun 21, 2013 11:07 am

Hi Chris,

I think the idea of importing the data first then restructing the workfile might work. I will try that out.
The graphing part definitely works well with me: the labeling is always correct and the options are convenient.

Thanks again for your help.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests