Surfstat.australia: an online text in introductory Statistics

SUMMARISING AND PRESENTING DATA

PRESENTING DATA FOR TWO CONTINUOUS MEASUREMENTS

Simple Methods for Time Series Analysis

(Adapted from Anderson Ch 12 and Kenkel Ch 19)

Observations at successive time intervals are called time series.

Usually the times measurements are evenly spaced.

Plots with time on the x-axis can reveal the main features of a time series

Four major reasons for peforming time series analysis:

  1. To forecast the value of the dependent variable e.g. a seller needs to forecast demand for the product.
  2. To describe or explain seasonal patterns e.g. how department store sales fluctuate from season to season.
  3. To quantify theories e.g. what is the magnitude of the effect on car sales of an increase in interest rates.
  4. To test theories e.g. test hypotheses about the relationship between variables.

Examples - UK softwood imports

MINITAB TSPLOT command

MINITAB has a command TSPLOT which plots the data using symbols to indicate times, e.g. for softwood data

        TSPLOT  10    C1;
        ORIGIN  1954.

shows the data (in C1) plotted in 10 - year intervals starting in 1954.

MTB > print c7

soft    
6902  7228  6829  6833  6421  7260  7686  7882  7568  7804  9103 
8639  8248  8734  8971  8165  8221  8181  8630  9746  7483  6428 
7348  6369  6709  7053  6131  5649  6237  6895  6643 

The points were joined by hand.

The data are very variable.

To get a clearer idea of the main pattern we need to smooth the data.

Two possible approaches:

  1. Fit a mathematical equation using regression methods. But the choice of a suitable equation may be difficult
  2. Use simple arithmetic methods.

In this section we look at some methods for approach 2.

Moving Averages

Calculate the average of the first 5 values,

i.e. for 1954 to 1958

Then calculate average of next 5 values, for 1955 -1959

and so on.

Then plot these against the middle of the period used for each average, i.e. plot m1 for 1956, m2 for 1957, etc. (you lose some points at the beginning and end). Here is the graph done in Excel:

More generally, let y1, y2, ... , yn denote the data.

For a 5-point moving average the first value is

MINITAB Macros

MINITAB can calculate moving averages by creating a "macro" (subprogram) to calculate mk and then running it for all the required values for k.

e.g. For the softwood data, to calculate 5-point moving averages (stored in C2) from the raw data (stored in C1) from k=1 (for 1954-58) to k=27 (for 1980-84) use

Results (in C2)

MTB > print c2

C2      
6842.6   6914.2   7005.8   7216.4   7363.4   7640.0   
8008.6   8199.2   8272.4   8505.6   8739.0   8551.4   
8467.8   8454.4   8433.6   8588.6   8452.2   8093.6   
7927.0   7474.8   6867.4   6781.4   6722.0   6382.2 
6355.8   6393.0   6311.0 

MTB > tsplot 10 c2;
SUBC> origin 1956.


        -                6
C2      -               5 7   1
        -                  890 2
        -             34
    8000+            2          34
        -
        -           1
        -          0              5
        -         9
    7000+       78
        -      6                   678
        -
        -                             9012
        -
    6000+
        -
        -
         +---------+---------+---------+---------+
      1950      1960      1970      1980      1990

Comments

  1. You can calculate moving averages with any number of terms, e.g. 4 point moving averages
  2. Similarly moving (or running) medians could be used; e.g. 3-point moving medians
  3. etc. For softwood data these would be 6902, 6833, 6829, 6833, 7260, etc - check the values.

  4. The number of observations used for moving averages depends on the application and the data
  5. average too many -> smooth out all pattern
    average too few -> too little smoothing

  6. More complicated moving averages are often used, e.g.
  7. (this is a 3-point weighted moving average with weights 1/4, 2/4 and 1/4)

  8. If there are regular (i.e. periodic) fluctuations these can be eliminated by using a moving average of the same length as the period.

Here is another example of a short time-series: the pump prices of unleaded petrol in Sydney and Newcastle in July 1997.

Progress check


... Previous page Next page ...