transforms quarterly data into annual ones
tsout=q2a(tsin,ind)
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
tsout = the corresponding annual time series
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