Professional Documents
Culture Documents
14.2.6 SPSS Time Series Analysis and Forecasting
14.2.6 SPSS Time Series Analysis and Forecasting
In this worksheet we will analyse seasonal data. Exponential smoothing and curve
fitting can be carried out quite easily in SPSS by following the instructions in the Help
menu.
The quarterly sales of a departmental store have been monitored for the past five years
with the following information being produced: (Tutorial question 12.1)
Total quarterly sales (0000s)
Year
Quarter 1
Quarter 2
Quarter 3
Quarter 4
2001
48
58
57
65
2002
50
61
59
68
2003
52
62
59
69
2004
52
64
60
73
2005
53
65
60
75
2.6.1 Type all the sales figures in chronological order in one column heading it Sales.
Then Data / Define dates Select Years, quarters / First case in Year 2001 quarter 1.
Look at the new variables in both Data Editor grids. They describe the year, the quarter
and their combination for use in time series diagrams. Save this file as Sales.
2.6.2 Plot a sequence graph of sales with date to see if an additive model is appropriate.
Graphs / Sequence / Variables: Sales / Time axis labels: Date
75
70
Quarterly Sales
65
60
55
50
45
05
20
4
Q 05
20
3
Q 05
20
Q2 05
20
1
Q 04
20
Q4 04
20
3
Q 04
20
Q2 04
20
Q1 03
20
4
Q 03
20
Q3 03
20
2
Q 03
20
1
Q 02
20
Q4 02
20
3
Q 02
20
Q2 02
20
1
Q 01
20
4
Q 01
20
Q3 01
20
01
20
Q1
Date
2.6.3 Assuming it is, carry out the seasonal decomposition using that model:
Analyse / Time Series / Seasonal Decomposition / Additive model / Endpoints
weighted by 0.5 / Display casewise listing Variable SALES.
Results of SEASON procedure for variable Sales.
Additive Model. Centered MA method. Period = 4.
DATE_
2001
2001
2001
2001
2002
2002
2002
2002
2003
2003
2003
2003
2004
2004
2004
2004
2005
2005
2005
2005
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Sales
48.000
58.000
57.000
65.000
50.000
61.000
59.000
68.000
52.000
62.000
59.000
69.000
52.000
64.000
60.000
73.000
53.000
65.000
60.000
75.000
Moving
averages
.
.
57.250
57.875
58.500
59.125
59.750
60.125
60.250
60.375
60.500
60.750
61.125
61.750
62.375
62.625
62.750
63.000
.
.
Ratios
.
.
-.250
7.125
-8.500
1.875
-.750
7.875
-8.250
1.625
-1.500
8.250
-9.125
2.250
-2.375
10.375
-9.750
2.000
.
.
Seasonal
factors
-8.961
1.883
-1.273
8.352
-8.961
1.883
-1.273
8.352
-8.961
1.883
-1.273
8.352
-8.961
1.883
-1.273
8.352
-8.961
1.883
-1.273
8.352
Seasonally Smoothed
adjusted
trend- Irregular
series
cycle component
56.961
56.416
.545
56.117
57.117
-1.000
58.273
57.364
.910
56.648
57.739
-1.090
58.961
58.551
.410
59.117
59.124
-.007
60.273
59.808
.465
59.648
60.072
-.424
60.961
60.329
.632
60.117
60.346
-.229
60.273
60.475
-.201
60.648
60.739
-.090
60.961
61.107
-.146
62.117
61.791
.326
61.273
62.253
-.979
64.648
62.850
1.799
61.961
62.662
-.701
63.117
63.013
.104
61.273
63.680
-2.406
66.648
64.294
2.354
Label
Error for Sales from SEASON, MOD_2 ADD CEN 4
Seas adj ser for Sales from SEASON, MOD_2 ADD CEN 4
Seas factors for Sales from SEASON, MOD_2 ADD CEN 4
Trend-cycle for Sales from SEASON, MOD_2 ADD CEN 4
2.6.4 Some new variables have been produced. Produce a sequence plot, as in Task 2.6.2,
adding the trend STC_1 to the graph. (Ignore the mod_2 name in the output)
75
Quarterly Sales
Trend-cycle for Sales
from SEASON,
MOD_2 ADD CEN 4
70
65
60
55
50
45
05
20
4
Q 005
2
Q3 005
2
Q2 005
2
1
Q 004
2
4
Q 004
2
3
Q 004
2
Q2 004
2
1
Q 003
2
4
Q 003
2
3
Q 003
2
Q2 003
2
1
Q 002
2
4
Q 002
2
3
Q 002
2
2
Q 002
2
1
Q 001
2
Q4 001
2
3
Q 001
2
2
Q 001
2
1
Q
Date
2.6.5 Make use of the seasonal factors and the smoothed trend cycle for making forecasts.
For an Additive model: Fitted values = Trend + Seasonal Factor so compute a new
variable, named FITTED_1, describing the fitted values:
Transform / Compute / Target variable type FITTED_1 = STC_1 + SAF_1
2.6.6 Plot a sequence graph of the Sales and the Fitted_1 values.
Graph / Sequence / Variables: Sales, Fitted_1 / Time axis labels: Date
75
Quarterly Sales
FITTED_1
70
65
60
55
50
45
05
20
Q4 005
2
Q3 005
2
Q2 005
2
Q1 004
2
Q4 004
2
Q3 004
2
Q2 004
2
Q1 003
2
Q4 003
2
3
Q 003
2
Q2 003
2
Q1 002
2
4
Q 002
2
3
Q 002
2
2
Q 002
2
1
Q 001
2
4
Q 001
2
3
Q 001
2
2
Q 001
2
1
Date
(d)
20
Minimum
48
Maximum
75
Mean
60.50
Std. Deviatio n
7.402
20
-2.40625
2.35417
.0135417
1.03950244
20
-2
-4
Error for Sales from SEASON, MOD_2 ADD CEN 4
Frequency
0
-2
-1
Mean = 0.0135417
Std. Dev. = 1.03950244
N = 20
N
Normal Parametersa,b
Mo st Extreme
Differences
Mean
Std. Deviatio n
Abso lute
Po s itive
Negative
Ko lmo go ro v-Smirno v Z
As ymp. Sig. (2-tailed)
Erro r fo r
Sales fro m
SEASON,
MOD_2
ADD CEN 4
20
.0135417
1.03950244
.126
.126
-.108
.563
.909
(e)
2.6.8, 2.6.9 Repeat Tasks 2.6.3 and 2.6.4 but use a multiplicative model
Results of SEASON procedure for variable Sales.
Multiplicative Model. Centered MA method. Period = 4.
DATE_
2001
2001
2001
2001
2002
2002
2002
2002
2003
2003
2003
2003
2004
2004
2004
2004
2005
2005
2005
2005
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Sales
48.000
58.000
57.000
65.000
50.000
61.000
59.000
68.000
52.000
62.000
59.000
69.000
52.000
64.000
60.000
73.000
53.000
65.000
60.000
75.000
Moving
averages
.
.
57.250
57.875
58.500
59.125
59.750
60.125
60.250
60.375
60.500
60.750
61.125
61.750
62.375
62.625
62.750
63.000
.
.
Ratios
(* 100)
.
.
99.563
112.311
85.470
103.171
98.745
113.098
86.307
102.692
97.521
113.580
85.072
103.644
96.192
116.567
84.462
103.175
.
.
Label
Error for Sales from SEASON, MOD_5 MUL CEN 4
Seas adj ser for Sales from SEASON, MOD_5 MUL CEN 4
Seas factors for Sales from SEASON, MOD_5 MUL CEN 4
Trend-cycle for Sales from SEASON, MOD_5 MUL CEN 4
75
Quarterly Sales
Trend-cycle for Sales
from SEASON,
MOD_5 MUL CEN 4
70
65
60
55
50
45
05
20
Q4 005
2
3
Q 005
2
2
Q 005
2
1
Q 004
2
4
Q 004
2
Q3 004
2
2
Q 004
2
Q1 003
2
4
Q 003
2
3
Q 003
2
2
Q 003
2
Q1 002
2
Q4 002
2
Q3 002
2
Q2 002
2
1
Q 001
2
4
Q 001
2
Q3 001
2
Q2 001
2
Q1
Date
2.6.10Make use of the Seasonal factors and the Smoothed trend cycle for making forecasts.
For a Multiplicative model: Fitted values = Trend x Seasonal Factor so compute a new
variable, named FITTED_2, describing the fitted values:
Transform / Compute / Target variable type FITTED_2 = STC_2 * SAF_2
2.6.11Plot a sequence graph of the Sales and the Fitted_2 values.
Graph / Sequence / Variables: Sales, Fitted_2 / Time axis labels: Date
75
Quarterly Sales
FITTED_2
70
65
60
55
50
45
05
20
4
Q 005
2
3
Q 005
2
2
Q 005
2
1
Q 004
2
4
Q 004
2
3
Q 04
20
2
Q 004
2
1
Q 003
2
4
Q 003
2
3
Q 003
2
2
Q 003
2
1
Q 002
2
4
Q 002
2
3
Q 002
2
2
Q 002
2
1
Q 001
2
4
Q 001
2
3
Q 001
2
2
Q 001
2
1
Q
Date
2.6.12For the multiplicative model, subtract the fitted values from the sales figures to find a set
of errors, ERR_3, which are comparable with those from the additive model.
2.6.13Comparing Residuals:
(a), (b), (c)
Quarterly Sales
Error fo r Sales fro m
SEASON, MOD_2
ADD CEN 4
ERR_3
Valid N (listwise)
(d)
20
Minimum
48
Maximum
75
Mean
60.50
Std. Deviation
7 .402
20
-2.40625
2.35417
.0135417
1.03950244
20
20
-2.25
2.55
.0464
.98065
-1
-2
-3
Error for Sales from SEASON, MOD_2 ADD
CEN 4
ERR_3
Frequency
0
-3
-2
-1
Mean = 0.0464
Std. Dev. = 0.98065
N = 20
3
ERR_3
N
No rmal Parametersa,b
Mos t Extreme
Differences
Mean
Std. Deviation
Abs o lute
Pos itive
Negative
Ko lmo go ro v-Smirno v Z
Asymp. Sig. (2-tailed)
Error for
Sales from
SEASON,
MOD_2
ADD CEN 4
20
.0135417
1.03950244
.126
.126
-.108
.563
.909
ERR_3
20
.0464
.98065
.193
.193
-.133
.862
.448
(e)
-1
-2
-3
05
20
4
Q 005
2
3
Q 005
2
2
Q 005
2
1
Q 004
2
4
Q 004
2
3
Q 004
2
2
Q 004
2
1
Q 003
2
4
Q 003
2
3
Q 003
2
2
Q 003
2
1
Q 002
2
4
Q 002
2
3
Q 002
2
2
Q 002
2
1
Q 01
20
4
Q 001
2
3
Q 001
2
2
Q 001
2
1
Q
Date
Which is the preferable model in your opinion? Why? Multiplicative as judged by its
errors.
2.6.14Assuming that the trend from the additive model is increasing by 0.3 per quarter, what
would be your forecasts for the four quarters of 2006?
Results of SEASON procedure for variable Sales.
Additive Model. Centered MA method. Period = 4.
DATE_
2004
2004
2005
2005
2005
2005
Q3
Q4
Q1
Q2
Q3
Q4
Sales
60.000
73.000
53.000
65.000
60.000
75.000
Moving
averages
62.375
62.625
62.750
63.000
63.3 .
63.6 .
63.9
64.2
64.5
64.8
Seasonally Smoothed
Seasonal
adjusted
trend- Irregular
Ratios factors
series
cycle component
-2.375
-1.273
61.273
62.253
-.979
10.375
8.352
64.648
62.850
1.799
-9.750
-8.961
61.961
62.662
-.701
2.000
1.883
63.117
63.013
.104
-1.273
61.273
63.680
-2.406
8.352
66.648
64.294
2.354
549 000
661 000
602 000
732 000