[R] Calculating quarterly statistics for time series object

From: Megh Dal <megh700004_at_yahoo.com>
Date: Sun, 29 Jun 2008 00:17:52 -0700 (PDT)


I have time series observation on daily frequencies :

library(zoo)
SD=1
date1 = seq(as.Date("01/01/01", format = "%m/%d/%y"), as.Date("12/31/02", format = "%m/%d/%y"), by = 1) len1 = length(date1); data1 = zoo(matrix(rnorm(len1, mean=0, sd=SD*0.5), nrow = len1),  date1) plot(data1)

Now I want to calculate 1. Quarterly statistics like mean, variance etc and 2. Weekly statistics, where as per my definition week starts from Wednesday and ends on Tuesday.

I can define some 'for' loop for doing those. However it takes considerably amount of time. Is there any advance methods in R to do the same?

Regards,

      
	[[alternative HTML version deleted]]


______________________________________________

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 29 Jun 2008 - 07:24:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 29 Jun 2008 - 12:31:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive