Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

W 15.2.6 T A F SPSS: Orksheet IME Series Nalysis AND Orecasting With

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 8

WORKSHEET 15.2.

6 TIME SERIES ANALYSIS AND FORECASTING WITH SPSS


In this worksheet we will just analyse seasonal data. Exponential smoothing and curve fitting
can be carried out easily in SPSS by following the instructions in the Help menu.
The quarterly sales, (0,000s), 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 (0,000s)
Year

Quarter 1

Quarter 2

Quarter 3

Quarter 4

1996

48

58

57

65

1997

50

61

59

68

1998

52

62

59

69

1999

52

64

60

73

2000

53

65

60

75

2.6.1 Enter the data in chronological order in one column heading it Sales.
Then Data / Define dates Select Years, quarters / First case in Year 1996 quarter 1.
Look at the new variables in the New data window. They describe the year, the quarter and
their combination for use in time series diagrams.
2.6.2 Plot a Sequence graph of Sales with Date as time labels to see which model seems appropriate.
Graphs / Sequence / Variables: Sales / Time axis labels: Date
2.6.3 Assuming it does 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.
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.
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, the Smoothed trend, STC_1, and the Fitted_1 values.
Graph / Sequence / Variables: Sales, STC_1, Fitted_1 / Time axis labels: Date
2.6.7 Residual analysis:
1

Remember that the residuals should: (a) be small, (b) have a mean of 0, (c) have a standard
deviation which is much smaller than that of Sales, (d) be normally distributed and (e) be
random timewise. The residuals have been saved as ERR_1.
(a), (b), (c)
(d)

Produce descriptive statistics of Sales and ERR_1.

For ERR_1 produce a boxplot and a histogram with a normal plot.


Carry out the K-S hypothesis test for normality:
Analyse / Nonparametric tests / 1 sample K-S / Normal distribution

(e)

Produce a sequence plot of the errors


Edit the chart to put a reference line at ERR_1 = 0.

2.6.8, 2.6.9 Repeat tasks 2.6.3, 2.6.4 but use a multiplicative model
2.6.10Make use of the Seasonal factors and the Smoothed trend cycle for making forecasts.
For an 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, the Smoothed trend, STC_2, and the Fitted_2 values.
Graph / Sequence / Variables: Sales, STC_2, Fitted_2 / Time axis labels: 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.13 Comparing residuals:
(a), (b), (c)
(d)

Produce descriptive statistics of Sales and ERR_1, ERR_3.

Produce boxplots and a histograms with a normal plots on ERR_1, ERR_3


Carry out the K-S hypothesis tests for normality:
Analyse / Nonparametric tests / 1 sample K-S / Normal distribution

(e)

Produce sequence plots of both sets of errors


Edit the charts to put a reference lines at 0.
Which is the better model in your opinion. Why? . . . . . . . . . . . . . . . . . . . . . .

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 2001?
2

60

50

40

Quarterly sales ('0 000)

Output from SPSS Time series and Forecasting output Worksheet


Task 2.6.2

80

70

00
20
4 0
Q 00
2
3 0
Q 200
2 0
Q 00
2
1 9
Q 99
1
4 9
Q 99
1
3 9
Q 99
1
2 9
Q 99
1
1 8
Q 99
1
4 8
Q 199
3 8
Q 99
1
2 8
Q 99
1
1 7
Q 99
1
4 7
Q 99
1
3 7
Q 99
1
2 7
Q 99
1
1 6
Q 199
4 6
Q 99
1
3 6
Q 99
1
2 6
Q 99
1
1
Q

Date

Looks seasonal with a quarterly pattern of four.

Task 2.6.3
Results of SEASON procedure for variable SALES.
Additive Model. Centered MA method. Period = 4.

DATE_
Q1 1996
Q2 1996
Q3 1996
Q4 1996
Q1 1997
Q2 1997
Q3 1997
Q4 1997
Q1 1998
Q2 1998
Q3 1998
Q4 1998
Q1 1999
Q2 1999
Q3 1999
Q4 1999
Q1 2000
Q2 2000
Q3 2000
Q4 2000

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

The following new variables are being created:


Name
ERR_3
SAS_3
SAF_3
STC_3

Label
Error for SALES from SEASON, MOD_4 ADD CEN 4
Seas adj ser for SALES from SEASON, MOD_4 ADD CEN 4
Seas factors for SALES from SEASON, MOD_4 ADD CEN 4
Trend-cycle for SALES from SEASON, MOD_4 ADD CEN 4

Task 2.6.4
80

70

60

50

Quarterly sales
('0 000)
Trend

40

01
20
4 01
Q 20 1
3 0
Q 20 1
2 0
Q 20 0
1 0
Q 20
4 00
Q 20 0
3 0
Q 20 0
2 0
Q 20 9
1 9
Q 19 9
4 9
Q 19 9
3 9
Q 19 9
2 9
Q 19 8
1 9
Q 19 8
4 9
Q 19 8
3 9
Q 19 8
2 9
Q 19 7
1 9
Q 19
4 97
Q 19 7
3 9
Q 19 7
2 9
Q 19
1
Q

Date

Task 2.6.6
80

70

60

Quarterly sales
('0 000)

50

Trend
Fitted values

40

00
20
4 00
Q 20 0
3 0
Q 20 0
2 0
Q 20 9
1 9
Q 19 9
4 9
Q 19 9
3 9
Q 19 9
2 9
Q 19 8
1 9
Q 19 8
4 9
Q 19 8
3 9
Q 19 8
2 9
Q 19
1 97
Q 19 7
4 9
Q 19 7
3 9
Q 19 7
2 9
Q 19 6
1 9
Q 19
4 96
Q 19 6
3 9
Q 19
2 96
Q 19
1
Q

Date

Looks a good fit.


Task 2.6.7 Residual analysis
Des criptive Statis tics

20

Minimum
48

Maximum
75

Mean
60.50

Std.
Deviation
7.40

20

-2.40625

2.35417

1.35E-02

1.0395024

N
Quarterly sales ('0 000)
Error for SALES from
SEASON, MOD_1 ADD
CEN 4
Valid N (listwise)

20

7
20

1
4
3

-1

Std. Dev = 1.04

Mean = .01
N = 20.00

-2

-2.50

19

-1.50
-2.00

-.50
-1.00

.50
0.00

1.50
1.00

2.50
2.00

-3
N=

20

Error for SALES from SEASON, MOD_1 ADD CEN 4

Error for SALES from

O ne-Sample Kolmogorov-Smirnov Tes t

N
Normal Parametersa,b
Most Extreme
Differences

Mean
Std. Deviation
Absolute
Positive
Negative

Kolmogorov-Smirnov Z
Asymp. Sig. (2-tailed)

Error for
SALES
from
SEASON,
MOD_1
ADD CEN
4
20
1.354E-02
1.0395025
.126
.126
-.108
.563
.909

a. Test distribution is Normal.


b. Calculated from data.

Error for SALES

-1

-2
-3
00
20
4 0
Q 20 0
3 00
Q 20
2 0
Q 20 0
1 9
Q 19 9
4 99
Q 19
3 9
Q 19 9
2 9
Q 19 9
1 98
Q 19
4 8
Q 19 9
3 98
Q 19
2 98
Q 19
1 7
Q 19 9
4 7
Q 19 9
3 97
Q 19
2 7
Q 19 9
1 96
Q 19
4 96
Q 19
3 6
Q 19 9
2 6
Q 19 9
1

Date

Errors seem OK on all counts.


6

Task 2.6.8
MODEL:

MOD_11.

Results of SEASON procedure for variable SALES.


Multiplicative Model. Centered MA method. Period = 4.

DATE_
Q1 1996
Q2 1996
Q3 1996
Q4 1996
Q1 1997
Q2 1997
Q3 1997
Q4 1997
Q1 1998
Q2 1998
Q3 1998
Q4 1998
Q1 1999
Q2 1999
Q3 1999
Q4 1999
Q1 2000
Q2 2000
Q3 2000
Q4 2000

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
.
.

Seasonal Seasonally Smoothed


factors
adjusted
trend- Irregular
(* 100)
series
cycle component
85.289
56.279
55.990
1.005
103.195
56.204
56.852
.989
98.153
58.072
57.356
1.012
113.363
57.338
57.858
.991
85.289
58.624
58.550
1.001
103.195
59.112
59.125
1.000
98.153
60.110
59.791
1.005
113.363
59.984
60.145
.997
85.289
60.969
60.362
1.010
103.195
60.081
60.361
.995
98.153
60.110
60.462
.994
113.363
60.866
60.762
1.002
85.289
60.969
61.102
.998
103.195
62.019
61.724
1.005
98.153
61.129
62.147
.984
113.363
64.395
62.748
1.026
85.289
62.142
62.605
.993
103.195
62.988
62.895
1.001
98.153
61.129
63.425
.964
113.363
66.159
63.909
1.035

The following new variables are being created:


Name

Label

ERR_2
SAS_2
SAF_2
STC_2

Error for SALES from SEASON, MOD_2 MUL CEN 4


Seas adj ser for SALES from SEASON, MOD_2 MUL CEN 4
Seas factors for SALES from SEASON, MOD_2 MUL CEN 4
Trend-cycle for SALES from SEASON, MOD_2 MUL CEN 4

Multiplicative model

Task 2.6.9
80

70

60

50

Quarterly sales
('0 000)
Trend

40

00
20
4 00
Q 20
3 00
Q 20 0
2 0
Q 20 9
1 9
Q 19 9
4 9
Q 19 9
3 9
Q 19 9
2 9
Q 19 8
1 9
Q 19 8
4 9
Q 19 8
3 9
Q 19 8
2 9
Q 19 7
1 9
Q 19 7
4 9
Q 19 7
3 9
Q 19 7
2 9
Q 19 6
1 9
Q 19 6
4 9
Q 19 6
3 9
Q 19 6
2 9
Q 19
1
Q

Date

Task 2.6.11

Multiplicative model
80

70

60

Quarterly Sales

50

Trend
Fitted values

40

00
20
4 00
Q 20 0
3 0
Q 20 0
2 0
Q 20 9
1 9
Q 19
4 99
Q 19 9
3 9
Q 19 9
2 9
Q 19 8
1 9
Q 19 8
4 9
Q 19 8
3 9
Q 19 8
2 9
Q 19 7
1 9
Q 19 7
4 9
Q 19 7
3 9
Q 19 7
2 9
Q 19 6
1 9
Q 19 6
4 9
Q 19 6
3 9
Q 19 6
2 9
Q 19
1
Q

Date

Des criptive Statistics

Task 2.6.13

20

Minimum
48

Maximum
75

Mean
60.50

Std.
Deviation
7.40

20

-2.40625

2.35417

1.35E-02

1.0395024

20

.96379

1.03521 1.0003909

1.48E-02

N
Quarterly sales ('0 000)
Errors from additive
model
Errors from
multiplicative model
Valid N (listwise)

20

3
20
20

16

-1

-2
19

19

-3
N=

20

Additive error

20

Multiplicative error

Both errors pass the normality test. Multiplicative model seems slightly preferable.

You might also like