Output Options Examples Reference
SAMA performs seasonal adjustment of time series by the moving average method.
SAMA (ARITH, PRINT) <input series> <output series> ;
Usage
SAMA is followed by the name of the series to be seasonally adjusted and then the name to be given to the new series. The two series may be the same, in which case the new one will just replace the old one. SAMA should not be used on series which can be negative.
When the print option is off, SAMA produces no printed output. The seasonally adjusted series is stored along with the intermediate results under the following names:
|
variable |
type |
length |
description |
|
@SFAC |
vector |
#periods |
Seasonal factors which divide the old series to make new series |
|
@MOVA |
series |
#obs |
The ratio of the old series to its moving average |
If the print option is on, these quantities are also printed in table form.
Method
Denote the series to be adjusted by X, indexed by t and T observations in length. The periodicity of the series (the number of periods per year) is p, which is customarily 4, in the case of quarterly series, or 12, in the case of monthly series. The ratio of the series to its moving average is formed in the following way:
MOVA(t) = X(t)/(Moving Average of X)
where the moving average of X is defined as
p=4: (1/4)*[X(t-2)/2 + X(t-1) + X(t) + X(t+1) + X(t+2)/2]
p=12: (1/12)*[X(t-6)/2 + X(t-5) + ... + X(t) + ... + X(t+5) + X(t+6)/2]
This equation describes a weighted moving average over p+1 observations centered at each observation in turn. The vector MOVA(t) may be rewritten as a matrix where each row corresponds to a year and contains p elements. The total number of non-missing elements in MOVA is T-p, because p/2 observations are dropped at the beginning and end of the series.
The p seasonal factors are formed by averaging each column in MOVA:
SFAC(1) = 1/(T-1) * (MOVA(2,1)+MOVA(3,1)+...+MOVA(T,1))
…….
SFAC(p) = 1/(T-1) * (MOVA(1,p)+MOVA(2,p)+...+MOVA(T-1,p))
They are normalized to average to unity either arithmetically or geometrically, depending on the option specified. The seasonally adjusted series is then computed by dividing the old series by the seasonal factors.
PRINT/NOPRINT specifies that the ratio of the series to its moving average and the computed seasonal factors be printed.
ARITH/NOARITH specifies that the arithmetic mean be used for normalization, rather than a geometric mean.
SAMA (PRINT,ARITH) GNPQ GNPQA;
SAMA (ARITH) GNPQ GNPQA ;
PRINT @SFAC @MOVA ;
These two examples have the same effect. The first prints the seasonal factors and the moving average ratio series. The second suppresses the printing, but then prints @SFAC and @MOVA, which are the same as what would have been printed.
Census Bureau, Seasonal Analysis of Economic Time Series, proceedings of the Conference on the Seasonal Analysis of Economic Time Series, September 1976.