<< m2a Time series num2date >>

Grocer >> Time series > m2q

m2q

transforms monthly data into quarterly ones

CALLING SEQUENCE

tsout=m2q(tsin,ind)

PARAMETERS

Input

* tsin = a monthly timeseries

* ind =

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

  - 0 if the quarterly data is to be the mean of the corresponding months

  - 1 if the quarterly data is to be the value of the first month

  - 2 if the quarterly data is to be the value of the second month

  - 3 if the quarterly data is to be the value of the third month

   ind is optional; if not provided, it is set to -1

 

Output

* tsout = the corresponding quarterly time series

DESCRIPTION

Transforms monthly data into quarterly ones.

EXAMPLE

x = reshape([1:24],'1978m2') // ceate a monthly ts
y = m2q(x) // provides a quarterly ts, from 1978q2 to 1979q4 with values 12, 21, 30, 39, 48, 57, 66
y = m2q(x,-1) // provides a quarterly ts, from 1978q2 to 1979q4 with values 12, 21, 30, 39, 48, 57, 66
y = m2q(x,3) // provides a quarterly ts, from 1978q1 to 1979q4 with values 2, 5, 8, 11, 14, 17, 20, 23

AUTHOR

Eric Dubois 2002

Report an issue
<< m2a Time series num2date >>