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