Page 1 of 1

Transforming daily series into weekly

Posted: Mon Feb 20, 2017 4:18 pm
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

Re: Transforming daily series into weekly

Posted: Mon Feb 20, 2017 4:34 pm
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.

Re: Transforming daily series into weekly

Posted: Mon Feb 20, 2017 5:53 pm
by msrahman
I have attached the daily data that I want to convert into monthly.
Thanks.
Sincerely,
Sajjadur.

Re: Transforming daily series into weekly

Posted: Mon Feb 20, 2017 6:18 pm
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.

Re: Transforming daily series into weekly

Posted: Tue Oct 03, 2017 1:49 pm
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,

Re: Transforming daily series into weekly

Posted: Tue Oct 03, 2017 2:40 pm
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.