Analyzing Daily/Weekly data using ts in R

Rajiv picture Rajiv · Dec 8, 2011 · Viewed 32.3k times · Source

I have just started playing with the ts class to analyze some time series data I have.

I am getting a sense that the ts class is not well suited for analyzing daily or weekly data. Almost all the examples I see on the web or in Cowpertwait and Metcalfe's "Introductory Time Series with R" use monthly or annual data.

I would like to use ts to analyze weekly data, is it not advisable ?

Answer

G. Grothendieck picture G. Grothendieck · Dec 8, 2011

The main problem is that most people who want to analyse daily or weekly data want to do something like use a frequency of 365 days per year or 52 weeks per year but the number of days or weeks in a year is not 365 or 52 or even constant. If you drop one day in leap years in the case of daily data, say, or use 7 days for each week of the year except one which has 8 or 9 days in the case of weekly data, say, then you can fudge it. An endless variety of schemes is possible.

Read through this thread for an example.