Name

da2q — transformation of daily data into quarterly ones

CALLING SEQUENCE

ts=da2q(ts,ind,dropna)

PARAMETERS

Input

• ts = a daily timeseries

• ind =

  * -1 if the quarterly data is to be the sum of the corresponding days

  * 0 if the  quarterly data is to be the mean of the corresponding days

  * n between 1 and 90 if the quarterly data is to be the value of the n-th day of the quarter

  * n > 90 if the quarterly data is to be the value of the last day of the quarter

• dropna = 'dropna' if the user wants to withdraw all NA values from the calculations (case ind=0 or -1) or to take the last non NA value of the quarter (case ind > 90)

• if not entered then all NA values are considered

Output

• ts = the corresponding quarterly time series

DESCRIPTION

Transforms daily data into quarterly ones.

EXAMPLE

load(GROCERDIR+'data\tsd.dat')
// tsd is a daily ts from 95/01/02 to 96/02/16 with all week-end values lacking
tsq=da2q(tsd,0)
//you obtain a quarterly time series from 2002q2 to 2007q2 with only NA values

tsq=da2q(tsd,0,'dropna')
//you obtain a quarterly time series from 2002q2 to 2007q2 with values equal for each quarter to the mean of all non NA daily values in the quarter

tsq=da2q(tsd,1)
//you obtain a quarterly time series from 2002q2 to 2007q3 with values equal to the values of each first day in the quarter, which can be eventually NA

tsq=da2q(tsd,1,'dropna')
//you obtain a quarterly time series from 2002q2 to 2007q3 with values equal to the values of each first day in the quarter ('dropna' does not change anything on this case)

sq=da2q(tsd,91)
//you obtain a quarterly time series from 2002q2 to 2007q2 with values equal to the values of each last day in the quarter

tsq=da2q(tsd,91,'dropna')
//you obtain a quarterly time series from 2002q2 to 2007q2 with values equal to last non NA value in the quarter
  

               

AUTHOR

Eric Dubois (2007)