Grocer Function
NAME
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
if x is a annual ts (such as reshape([1:13],'1978q2') then
1) y = q2a(x)
2) y = q2a(x,-1)
3) y = q2a(x,2)
Examples 1 and 2 give exactly the same result: a yearly ts (from 1979a to 1980a with values 22 and 38 with the ts x above).
Example 3 gives a yearly ts whose values come from the second quarter of each year (from 1978a to 1981q4 with values 1, 5, 9, 13 with the ts x above).
AUTHOR
Eric Dubois 2002