Transforming daily series into weekly

For questions and discussion related to reading in and working with data.
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Transforming daily series into weekly

Unread post by msrahman »

Hello,

I want to transform a daily series into a weekly one using following instructions, but it is not working. Can anyone please guide me?


open data C:\laptop\Oil_hetero\Data\Weekly\Daily_Three_Variables.xls
CAL(W) 1986:01:03
All 2016:10:28
data(for=XLS,org=obs,compact=average) / OIL
print / OIL

Thanks.

Sincerely,
Sajjadur Rahman
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Transforming daily series into weekly

Unread post by TomDoan »

Could you attach the data file? The most common error is to put the weekly CALENDAR setting as the start rather than end of the desired week.
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Re: Transforming daily series into weekly

Unread post by msrahman »

I have attached the daily data that I want to convert into monthly.
Thanks.
Sincerely,
Sajjadur.
Attachments
Daily_Three_Variables.xls
These are daily data
(665.5 KiB) Downloaded 821 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Transforming daily series into weekly

Unread post by TomDoan »

Your date column is set up to show times (1986:01:02 is 1986 O'Clock which is 82 and a fraction days),... rather than dates. How was that created? I'm not even sure how to unwind that to create proper date coding since ordinarily Excel codes the time of day as a fraction. (.0000 is midnight to .99999999999 is effectively midnight of the next day), so hour() hacks information out of the fractional part of the value.
Nairoman
Posts: 2
Joined: Tue Oct 16, 2012 10:02 am

Re: Transforming daily series into weekly

Unread post by Nairoman »

Dear Mr. Doan,

This kind of aggregation is a procedure often done in economics/finance. Would be nice to have an example of how to do it in RATS.

See for instance the data at:
https://www.eia.gov/dnav/ng/ng_pri_fut_s1_d.htm

where daily data are provided and then aggregated at weekly, monthly, and annual frequencies.

Is it possible to replicate such results?

Thanks,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Transforming daily series into weekly

Unread post by TomDoan »

That would depend upon what method is used to aggregate the data. However, we have a section in the Introduction about compacting data.
Post Reply