<< prtts Time series reshape >>

Grocer >> Time series > q2a

q2a

transforms quarterly data into annual ones

CALLING SEQUENCE

tsout=q2a(tsin,ind)

PARAMETERS

Input

* tsin = a qurterly timeseries

* ind =

  . -1 if the annual data is to be the sum of the corresponding quarters

  . 0 if the annual data is to be the mean of the corresponding quarters

  . 1 if the annual data is to be the value of the first quarter

  . 2 if the annual data is to be the value of the second quarter

  . 3 if the annual data is to be the value of the third quarter

  . 4 if the annual data is to be the value of the fourth quarter

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

 

Output

* tsout = the corresponding annual time series

DESCRIPTION

Transforms quarterly data into annual ones.

EXAMPLE

x =reshape([1:13],'1978q2') // create a quarterly ts
y = q2a(x) // returns an annual ts, from 1979a to 1980a with values 22 and 38
y = q2a(x,-1) // returns the same annual ts
y = q2a(x,2) // returns an annual ts, from 1978a to 1981a with values 1, 5, 9, 13

AUTHOR

Eric Dubois 2002

Report an issue
<< prtts Time series reshape >>