[R] dividing ts objects of different frequencies

Stephen J. Barr stephenjbarr at gmail.com
Wed Mar 4 20:17:57 CET 2009


Hello,

First, sorry for sending HTML emails earlier. This should now be in
plain-text mode.

I have two time series (ts) objects, 1 is yearly (population) and the
other is quarterly (bankruptcy statistics). I would like to produce a
quarterly time series object that consists of bankruptcy/population.
Is there a pre-built function to intelligently divide these time
series:

br.ts = ts(data=br.df[,-1], frequency = 4, start=c(2001,1), end=c(2008,2))
distPop.ts = ts(data=distPop.df[,-1], frequency=1, start=2000, end=2008)

The time series would consist of the elements (in pseudocode):

br.ts[2001Q1]/distPop.ts[2001] , br.ts[2001Q2]/distPop[2001],
br.ts[2001Q3]/distPop.ts[2001] , br.ts[2001Q4]/distPop[2001],
br.ts[2002Q1]/distPop.ts[2002] , br.ts[2002Q2]/distPop[2002],
etc.

I know that this would not be too difficult to write but does anything
like this already exist?

Thank you,

-stephen



-- 
==========================================
Stephen J. Barr
University of Washington
Dept. of Applied and Computational Math Sciences
Dept. of Economics
WEB: www.econsteve.com
==========================================



-- 
==========================================
Stephen J. Barr
University of Washington
Dept. of Applied and Computational Math Sciences
Dept. of Economics
WEB: www.econsteve.com




More information about the R-help mailing list