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 and find the value of for any period.
- Use technology to fit a least-squares trend line 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 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 from the first one.
Mean daily water use per person in a south-east Queensland town, 2015–2024 (data are illustrative). The least-squares line through is the trend line.
Key idea
The trend line
Fit a least-squares line with the time period as the explanatory variable:
- Slope : 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 : the trend value at , the period before the data starts. It is rarely of practical interest.
Always say what is, and write the line with words.
Worked example
Fit and interpret a trend line for annual data
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 for 2015, use technology to fit a least-squares trend line. Give the coefficients correct to two decimal places.
b) Interpret the slope.
Step 1: Set up the time variable
Enter in the list (2015 is , 2024 is ) and the water use in the list.
Time is the explanatory variable. Numbering periods from 1 keeps the intercept sensible.
Step 2: Run the linear regression
The calculator (or
=SLOPEand=INTERCEPTin a spreadsheet) gives , and .Step 3: Write the trend line
where is 2015.
Step 4: Interpret the slope
Each year, mean daily water use is predicted to decrease by about 2.78 L per person.
Try it yourself first, then check the working one step at a time.
Answer
, with in 2015. Water use is decreasing by about 2.78 L per person per day each year (, a strong decreasing trend).
Method
Number the periods and say what is.
Fit the least-squares line of the variable against .
Interpret the slope as the change per period, with units.
Watch out for
Using the year as , 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 for Q1 2022. What is the value of 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, (Q1 2022) to (Q4 2024):
: 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:
: a strong, clear increasing trend of about 556 guest nights per quarter.
Worked example
Fit a trend line to deseasonalised data
The deseasonalised guest nights (thousands) at the holiday park, from Q1 2022 () to Q4 2024 (), are:
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Deseasonalised | 30.11 | 30.09 | 30.08 | 29.74 | 32.49 | 32.95 | 32.16 | 32.53 | 34.87 | 34.38 | 35.27 | 35.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.
Step 1: Enter the data
values in the list, deseasonalised values in the list.
The trend line is fitted to deseasonalised values so the seasonal zigzag doesn't distort it.
Step 2: Run the regression
Technology gives , and .
Step 3: Write the line
Step 4: Interpret
Deseasonalised guest nights are increasing by about 0.556 thousand, or 556 guest nights, per quarter. shows a strong, increasing linear trend.
Try it yourself first, then check the working one step at a time.
Answer
(thousands, is Q1 2022). Deseasonalised guest nights increase by about 556 per quarter; indicates a strong increasing trend.
Method
Deseasonalise first (or use the deseasonalised values given).
Fit the least-squares line of deseasonalised value against .
Interpret the slope per period, and use to describe the strength of the trend.
Watch out for
Fitting the line to the raw guest nights, which gives with .
Saying "per year" when counts quarters.
For the holiday park, , where guest nights are in thousands and is Q1 2022. What does the slope tell you?
| To find | Formula |
|---|---|
| Slope | =SLOPE(D2:D13, A2:A13) |
| Intercept | =INTERCEPT(D2:D13, A2:A13) |
| Correlation | =CORREL(A2:A13, D2:D13) |
Common mistake
Using the year as the explanatory variable
If you enter 2015, 2016, … as 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 , and say what stands for.
Using with for 2015, find the trend value of water use for 2026, to the nearest litre.
Summary
A trend line is a least-squares line with the time period 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 is, and write the line with words: .
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.