# Plotting moving averages

**Plotting moving averages**

A moving average graph is more useful when analysing information because it can smooth out random fluctuations in the data to provide a better trend.

**Plotting moving averages on a time series graph**

An example of plotting a moving average graph is as follows:

The data below represents the number of times during the day a car goes past a speed camera.

29, 28, 28, 21, 29, 28, 29, 27, 30, 28

This is represented as a time-series graph as follows:

In order to calculate a five point moving average for example onto the above graph, the following averages are calculated

29, 28, 28, 21, 29, 28, 29, 27, 30, 28

5 point mean:

27.0, 26.8, 27.0, 26.8, 28.6, 28.4 (at every 5 groups of data, the mean is calculated)

The position on the graph would then need to be calculated using the following method:

Range Method Position on graph

1st – 5th (1 + 7) ÷ 2 4

2nd – 6th (2 + 8) ÷ 2 5

3rd – 7th (3 + 9) ÷ 2 6

These sets of moving average data is then plotted on the time-series graph as per below: