Transforming daily (but irregular) data to weekly frequency

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Kavorka
Posts: 47
Joined: Mon Nov 30, 2009 6:06 am

Transforming daily (but irregular) data to weekly frequency

Postby Kavorka » Wed Mar 16, 2011 5:44 pm

I have a time-series of irregular but dated daily data, that I would like to transform to weekly data. The problem is that the daily data is only registered when the interest rate is changed (so the frequency is irregular), and all other rows are simply excluded from the series (when the interest rate is not changed). Thus, there are no dated rows with missing values. To make it more complicated, sometimes the interest rate is not changed for over e.g. 2 weeks, which implies that there can be e.g. 38 daily observations in a year (if the interest rate is only changed 38 times during a year).

I added an excel file with a short illustration of how this series may look like (the format of the dates are 20110204, which means year:2011, month:02, day: 04).

I really do appreciate if some clever person can solve this programming problem. It must be a problem that other people also have encountered.

/Kavorka
Attachments
Interest rates.xls
(33.5 KiB) Downloaded 460 times

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

Re: Transforming daily (but irregular) data to weekly freque

Postby EViews Gareth » Wed Mar 16, 2011 5:51 pm

Just open it in EViews, create a weekly page and copy it over to the weekly page.

Something like:

Code: Select all

open "interest rates.xls" pagecreate(page="weekly") w 2005 2011 copy untitled\interest_rate weekly\interest_rate

Kavorka
Posts: 47
Joined: Mon Nov 30, 2009 6:06 am

Re: Transforming daily (but irregular) data to weekly freque

Postby Kavorka » Thu Mar 17, 2011 12:13 pm

Excellent, thanks a lot for the solution to this problem!

However, if I understand this correctly the date for every created weekly average of the observations is placed on an incorrect date. It is placed on the Saturday at the PREVIOUS week (the week before the week we calculate the average for). Correct me if I am wrong.

(I still use version 6. I have bought version 7 but have not installed it yet.)

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

Transforming daily (but irregular) data to weekly frequency

Postby EViews Gareth » Thu Mar 17, 2011 12:20 pm

Try EViews 7.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests