Lesson 6 of 7 · 16 min

Fitting a trend line

Model the long-term trend of a time series with a least-squares line against the time period t, fitted to deseasonalised values when the data is seasonal, and interpret it.

What you will be able to do

  • Number the periods t=1,2,3,…t = 1, 2, 3, \ldots and find the value of tt for any period.
  • Use technology to fit a least-squares trend line y=mt+cy = mt + c to a time series.
  • Fit the trend line to deseasonalised values when the data is seasonal, and explain why.
  • Interpret the slope and intercept of a trend line in context.

In Bivariate data analysis 2 you fitted a least-squares line y=mx+cy = mx + c to a scatterplot. A trend line is the same line with time as the explanatory variable. Instead of using the year (2015, 2016, …), which makes the intercept enormous and meaningless, number the periods t=1,2,3,…t = 1, 2, 3, \ldots from the first one.

Interactive

A trend line for water use

Mean daily water use per person in a south-east Queensland town, 2015–2024 (data are illustrative). The least-squares line through (t,water use)(t, \text{water use}) is the trend line.

Key idea

The trend line

Fit a least-squares line with the time period tt as the explanatory variable:

y=mt+cy = mt + c
  • Slope mm: the change in the trend value per period — "each year, water use is predicted to fall by 2.78 L per person per day".
  • Intercept cc: the trend value at t=0t = 0, the period before the data starts. It is rarely of practical interest.

Always say what t=1t = 1 is, and write the line with words.

Worked example

Fit and interpret a trend line for annual data

  • Simple familiar
  • Technology active

Mean daily water use per person (litres) in a south-east Queensland town for 2015 to 2024 was

182, 176, 179, 171, 168, 170, 163, 160, 162, 155.

a) Using t=1t = 1 for 2015, use technology to fit a least-squares trend line. Give the coefficients correct to two decimal places.

b) Interpret the slope.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Number the periods t=1,2,3,…t = 1, 2, 3, \ldots and say what t=1t = 1 is.

  2. Fit the least-squares line of the variable against tt.

  3. Interpret the slope as the change per period, with units.

Watch out for

  • Using the year as xx, which gives an intercept of about 5774 — correct, but useless.

  • Interpreting the slope without the time unit ("decreases by 2.78") or the direction.

Quarterly data starts with t=1t = 1 for Q1 2022. What is the value of tt for Q3 2025?

For seasonal data, fit the trend line to the deseasonalised values. The seasonal zigzag in the raw data is not part of the trend, but a least-squares line through the raw values is pulled about by it — by which seasons happen to come first and last, and by the extra scatter. Deseasonalising first removes the zigzag, so the line follows the underlying level.

Trend line through the raw values

Holiday park, t=1t = 1 (Q1 2022) to t=12t = 12 (Q4 2024):

guest nights=0.462t+29.5\text{guest nights} = 0.462t + 29.5

r=0.23r = 0.23: the seasonal swing swamps the trend, and the slope is pulled down because every year begins with its Q1 peak.

Trend line through the deseasonalised values

Same data, deseasonalised first:

deseasonalised guest nights=0.556t+28.885\text{deseasonalised guest nights} = 0.556t + 28.885

r=0.94r = 0.94: a strong, clear increasing trend of about 556 guest nights per quarter.

Worked example

Fit a trend line to deseasonalised data

  • Complex familiar
  • Technology active

The deseasonalised guest nights (thousands) at the holiday park, from Q1 2022 (t=1t = 1) to Q4 2024 (t=12t = 12), are:

tt123456789101112
Deseasonalised30.1130.0930.0829.7432.4932.9532.1632.5334.8734.3835.2735.32

a) Fit a least-squares trend line to the deseasonalised data, with coefficients correct to three decimal places.

b) Interpret the slope, and comment on the strength of the trend.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Deseasonalise first (or use the deseasonalised values given).

  2. Fit the least-squares line of deseasonalised value against tt.

  3. Interpret the slope per period, and use rr to describe the strength of the trend.

Watch out for

  • Fitting the line to the raw guest nights, which gives 0.462t+29.50.462t + 29.5 with r=0.23r = 0.23.

  • Saying "per year" when tt counts quarters.

For the holiday park, deseasonalised guest nights=0.556t+28.885\text{deseasonalised guest nights} = 0.556t + 28.885, where guest nights are in thousands and t=1t = 1 is Q1 2022. What does the slope tell you?

Choose one answer
With a spreadsheet: column A holds tt, column D the deseasonalised values (rows 2 to 13).
To findFormula
Slope mm=SLOPE(D2:D13, A2:A13)
Intercept cc=INTERCEPT(D2:D13, A2:A13)
Correlation rr=CORREL(A2:A13, D2:D13)

Common mistake

Using the year as the explanatory variable

If you enter 2015, 2016, … as xx you get a correct line, but its intercept is the value in the year 0 — about 5774 L per person per day. It's easy to round badly and impossible to interpret. Number the periods with tt, and say what t=1t = 1 stands for.

Using water use=−2.78t+183.87\text{water use} = -2.78t + 183.87 with t=1t = 1 for 2015, find the trend value of water use for 2026, to the nearest litre.

in L per person per day

Round to the nearest whole number.

Summary

  • A trend line is a least-squares line with the time period t=1,2,3,…t = 1, 2, 3, \ldots as the explanatory variable.

  • For seasonal data, fit it to the deseasonalised values, not the raw ones.

  • The slope is the change in the trend per period (per quarter, per year) — give units.

  • State what t=1t = 1 is, and write the line with words: deseasonalised guest nights=0.556t+28.885\text{deseasonalised guest nights} = 0.556t + 28.885.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 6 of 70% read

Save your progress with a free account