๐Ÿ“ˆ Regression and Exponential Models

A Level Maths Year 2 ยท Statistics

Level 3 · Ages 17–18

← Back to topic overview
1 Interpreting the Correlation Coefficient

In Year 1 you described correlation by eye from a scatter diagram (see Correlation and Outliers). In Year 2 you attach a number to it: the product moment correlation coefficient, written $r$. You find it with the statistics mode of your calculator โ€” you are not expected to compute it by hand.

$r$ measures the strength of linear association between two variables. It always lies in the range $-1 \leqslant r \leqslant 1$. The closer $|r|$ is to $1$, the closer the points lie to a straight line.
Value of $r$DescriptionScatter diagram
$r = 1$Perfect positive linear correlationPoints exactly on a line with positive gradient
$0.7 \lesssim r < 1$Strong positive correlationPoints close to an upward line
$0.3 \lesssim r \lesssim 0.7$Moderate / weak positive correlationAn upward trend with a lot of scatter
$r \approx 0$No linear correlationNo straight-line pattern (there may be a curved one)
$-1 < r \lesssim -0.7$Strong negative correlationPoints close to a downward line
$r = -1$Perfect negative linear correlationPoints exactly on a line with negative gradient
Correlation does not imply causation. Ice-cream sales and drownings are positively correlated, but both are driven by a third variable โ€” hot weather. In an answer, say "there is an association", not "$x$ causes $y$", unless the context makes a causal link obvious.
$r \approx 0$ does not mean "no relationship". Points lying on a perfect U-shaped curve can give $r = 0$. The coefficient only detects linear association, so always look at the scatter diagram too.
Is $r$ big enough? Whether a given value of $r$ is evidence of genuine correlation depends on the sample size: $r = 0.6$ is convincing from $30$ points but not from $5$. Deciding this properly is a hypothesis test โ€” see Testing for Correlation.
2 The Regression Line $y = a + bx$

The least squares regression line of $y$ on $x$ is the straight line that makes the sum of the squared vertical distances from the points to the line as small as possible. Your calculator gives the values of $a$ and $b$ directly.

Regression line of $y$ on $x$
$y = a + bx$
$b$ = gradient  ·  $a$ = $y$-intercept  ·  the line always passes through $(\bar{x},\,\bar{y})$
Explanatory and response variables. $x$ is the explanatory (independent) variable โ€” the one that is controlled or that you know. $y$ is the response (dependent) variable โ€” the one you want to predict. The line of $y$ on $x$ is only for predicting $y$ from $x$.
CoefficientMeaning in contextTypical wording
$b$The change in $y$ for each increase of $1$ unit in $x$"For each extra hour of revision the score increases by about $3.8$ marks."
$a$The value of $y$ when $x = 0$"A student who does no revision is predicted to score about $31$ marks."
Interpreting $a$ can be nonsense. If $x = 0$ is far outside the data, $a$ is an extrapolation and may have no sensible meaning (for example a negative mass). Say so if that is the case.
Worked Example 1 โ€” Finding and interpreting a regression line

Eight students recorded the number of hours of revision, $x$, and their test score out of $100$, $y$.

$x$24578101113
$y$3845525563667480

Find $r$ and the equation of the regression line of $y$ on $x$, and interpret the coefficients.

โ‘ Enter the data in two-variable statistics mode. The calculator gives $r = 0.991$ (3 s.f.).
โ‘กIt also gives $a = 30.69\ldots$ and $b = 3.790\ldots$, so $y = 30.7 + 3.79x$.
โ‘ข$r = 0.991$ is very close to $1$: strong positive linear correlation, so a linear model is appropriate.
โ‘ฃ$b = 3.79$: each extra hour of revision is associated with about $3.8$ more marks.
โ‘ค$a = 30.7$: a student who did no revision would be predicted to score about $31$. ($x = 0$ is just outside the data, so treat this with caution.)
Check: $\bar{x} = 7.5$ and $\bar{y} = 59.125$; $30.69 + 3.791 \times 7.5 = 59.12$ โœ“ โ€” the line passes through the mean point.
0 2 4 6 8 10 12 14 30 40 50 60 70 80 90 Hours of revision, x Score, y y = 30.7 + 3.79x
3 Interpolation and Extrapolation
Interpolation means predicting within the range of the data. It is usually reliable, provided the correlation is strong.
Extrapolation means predicting outside the range of the data. It is unreliable, because there is no evidence that the linear pattern continues.
Worked Example 2 โ€” Reliability of predictions

Using $y = 30.69 + 3.791x$ from Worked Example 1, estimate the score of a student who revises for (a) $9$ hours, (b) $20$ hours, and comment on the reliability of each estimate.

โ‘ (a) $y = 30.69 + 3.791 \times 9 = 64.8$, so about $65$ marks.
โ‘ก$x = 9$ lies inside the data range $2 \leqslant x \leqslant 13$ (interpolation) and $r = 0.991$ is strong, so this is reliable.
โ‘ข(b) $y = 30.69 + 3.791 \times 20 = 106.5$ marks.
โ‘ฃThis is extrapolation, and the answer is impossible โ€” the test is out of $100$. The linear model must break down for large $x$; the estimate is unreliable.
Do not use the line of $y$ on $x$ to predict $x$ from $y$. The least squares line minimises vertical distances only. Exam questions are set so that you predict the response variable from the explanatory one.
Worked Example 3 โ€” Interpreting a negative gradient

For $12$ towns, the regression line of the mean daily heating cost, $c$ pence, on the mean outdoor temperature, $T$ ยฐC, is $c = 248 - 9.6T$, for $2 \leqslant T \leqslant 14$. Interpret the gradient, and explain why the model should not be used to estimate the cost when $T = 30$.

โ‘ For every $1$ ยฐC rise in temperature, the daily heating cost falls by about $9.6$ pence.
โ‘กAt $T = 30$ the model gives $c = 248 - 288 = -40$: a negative cost, which is impossible.
โ‘ข$T = 30$ is far outside the data range, so this is extrapolation. In reality the cost would level off at zero once heating is switched off.
4 Change of Variable: $y = kb^x$

Many relationships are not linear โ€” population growth, radioactive decay, depreciation. The trick is to change the variable so the relationship becomes linear, and then use a regression line. This links directly to the logarithm work in DfE content area F.

Exponential model
$y = kb^x \quad\Longrightarrow\quad \log y = \log k + x\log b$
Plot $\log y$ against $x$: gradient $= \log b$, intercept $= \log k$
If the regression line of $\log_{10} y$ on $x$ is $\log_{10} y = c + mx$, then \[ k = 10^{c}, \qquad b = 10^{m}. \] If natural logs are used, $\ln y = c + mx$ gives $k = \mathrm{e}^{c}$ and $b = \mathrm{e}^{m}$, i.e. $y = \mathrm{e}^{c}\mathrm{e}^{mx}$.
Worked Example 4 โ€” From a log-linear line to $y = kb^x$

The number of bacteria, $N$, in a culture was counted every hour.

$t$ (hours)012345
$N$5279118180265401
$\log_{10} N$1.71601.89762.07192.25532.42322.6031

Find a model of the form $N = kb^t$.

โ‘ Regression of $\log_{10} N$ on $t$ (calculator): $\log_{10} N = 1.7186 + 0.17703t$, with $r = 0.99995$.
โ‘กThe near-perfect $r$ for the transformed data supports an exponential model.
โ‘ข$k = 10^{1.7186} = 52.3$  and  $b = 10^{0.17703} = 1.50$.
โ‘ฃ$N = 52.3 \times 1.50^{t}$: the initial count is about $52$, and the population grows by about $50\%$ per hour.
Worked Example 5 โ€” Natural logarithms

The temperature excess, $\theta$ ยฐC, of a cooling liquid satisfies $\ln\theta = 2.1 - 0.35t$, where $t$ is in minutes. Write the model in the form $\theta = Ab^t$.

โ‘ $\theta = \mathrm{e}^{2.1 - 0.35t} = \mathrm{e}^{2.1} \times \left(\mathrm{e}^{-0.35}\right)^t$
โ‘ก$\mathrm{e}^{2.1} = 8.17$ and $\mathrm{e}^{-0.35} = 0.705$ (3 s.f.)
โ‘ข$\theta = 8.17 \times 0.705^{t}$ โ€” the excess falls by about $29.5\%$ each minute.
5 Change of Variable: $y = ax^n$
Power model
$y = ax^n \quad\Longrightarrow\quad \log y = \log a + n\log x$
Plot $\log y$ against $\log x$: gradient $= n$, intercept $= \log a$
ModelPlotGradientIntercept
$y = kb^x$$\log y$ against $x$$\log b$$\log k$
$y = ax^n$$\log y$ against $\log x$$n$$\log a$
Which model? If the variable $x$ is in the power ($b^x$), only $y$ is logged. If $x$ is the base ($x^n$), both are logged. The gradient of a logโ€“log graph is the power itself โ€” no need to undo a logarithm.
Worked Example 6 โ€” A power law from data

The period, $T$ seconds, of a pendulum of length $L$ cm was measured.

$L$1020406080100
$T$0.640.891.271.551.802.01

Show that a model $T = aL^n$ is appropriate and find $a$ and $n$.

โ‘ Compute $X = \log_{10} L$ and $Y = \log_{10} T$: e.g. $L = 10$ gives $(1,\,-0.1938)$; $L = 100$ gives $(2,\,0.3032)$.
โ‘กRegression of $Y$ on $X$: $Y = -0.6958 + 0.4991X$, with $r = 0.99992$ โ€” the logโ€“log points are almost exactly linear, so a power model fits.
โ‘ข$n = 0.499 \approx 0.5$ and $a = 10^{-0.6958} = 0.201$.
โ‘ฃ$T \approx 0.201L^{0.5} = 0.201\sqrt{L}$ โ€” the familiar result that the period is proportional to the square root of the length.
Worked Example 7 โ€” Reading a model from a logโ€“log line

A line of best fit for $\log_{10} y$ against $\log_{10} x$ has gradient $1.6$ and passes through $(0,\,0.48)$. Find $y$ in the form $ax^n$ and estimate $y$ when $x = 5$.

โ‘ $\log_{10} y = 0.48 + 1.6\log_{10} x$
โ‘ก$n = 1.6$ and $a = 10^{0.48} = 3.02$, so $y = 3.02x^{1.6}$.
โ‘ข$x = 5$: $y = 3.02 \times 5^{1.6} = 3.02 \times 13.13 = 39.7$.
6 Quick Reference

PMCC $r$

$-1 \leqslant r \leqslant 1$; measures linear association only.

Regression line

$y = a + bx$ predicts $y$ from $x$; passes through $(\bar{x},\bar{y})$.

Gradient $b$

Change in $y$ per unit increase in $x$.

Intercept $a$

Value of $y$ when $x = 0$ โ€” may be meaningless.

Interpolation

Within the data range: reliable if $r$ is strong.

Extrapolation

Outside the data range: unreliable.

$y = kb^x$

$\log y$ vs $x$; $k = 10^{\text{intercept}}$, $b = 10^{\text{gradient}}$.

$y = ax^n$

$\log y$ vs $\log x$; $n$ = gradient, $a = 10^{\text{intercept}}$.

Causation

Correlation alone never proves cause and effect.

7 Practice Questions

Ten questions, from routine to exam-style. Work each one through before opening the solution.

Question 1

For $20$ households, the correlation coefficient between outdoor temperature and gas used is $r = -0.87$. Describe the correlation and interpret it in context.

โ–ถ Show solution

Strong negative linear correlation.

Households tend to use less gas on warmer days. (This is an association; the coefficient alone does not prove cause.)

Question 2

The regression line of daily ice-cream sales, $s$, on maximum temperature, $t$ ยฐC, is $s = 45 + 12.5t$. Interpret the values $12.5$ and $45$.

โ–ถ Show solution

$12.5$: for each $1$ ยฐC rise in maximum temperature, about $12.5$ more ice creams are sold per day.

$45$: on a day with maximum temperature $0$ ยฐC the model predicts $45$ sales โ€” but $0$ ยฐC is probably outside the data, so this may not be reliable.

Question 3

The data used in Question 2 had $10 \leqslant t \leqslant 28$. Estimate the sales when $t = 20$ and when $t = 35$, commenting on the reliability of each.

โ–ถ Show solution

$t = 20$: $s = 45 + 250 = 295$. Interpolation โ€” reliable if the correlation is strong.

$t = 35$: $s = 45 + 437.5 = 482.5$, about $483$. Extrapolation โ€” unreliable; e.g. the shop may sell out, or people may avoid extreme heat.

Question 4

The regression line of $\log_{10} y$ on $x$ is $\log_{10} y = 0.6 + 0.2x$. Express $y$ in the form $kb^x$.

โ–ถ Show solution

$y = 10^{0.6 + 0.2x} = 10^{0.6} \times \left(10^{0.2}\right)^x$

$k = 10^{0.6} = 3.98$, $b = 10^{0.2} = 1.58$ (3 s.f.)

$y = 3.98 \times 1.58^{x}$

Question 5

The regression line of $\log_{10} y$ on $\log_{10} x$ is $\log_{10} y = 0.48 + 1.6\log_{10} x$. Find $a$ and $n$ such that $y = ax^n$.

โ–ถ Show solution

$\log_{10} y = \log_{10}\left(10^{0.48}\right) + \log_{10}\left(x^{1.6}\right) = \log_{10}\left(10^{0.48}x^{1.6}\right)$

$a = 10^{0.48} = 3.02$ and $n = 1.6$.

Question 6

A population of a rare plant is modelled by $\ln P = 4.2 - 0.08t$, where $t$ is in years. (a) Write the model as $P = Ab^t$. (b) Estimate $P$ when $t = 10$.

โ–ถ Show solution

(a) $P = \mathrm{e}^{4.2}\left(\mathrm{e}^{-0.08}\right)^t = 66.7 \times 0.923^{t}$

(b) $P = \mathrm{e}^{4.2 - 0.8} = \mathrm{e}^{3.4} = 29.96$, so about $30$ plants.

Question 7

Explain why, if $y = kb^x$, a graph of $\log y$ against $x$ is a straight line. State what graph you would plot to test whether $y = ax^n$.

โ–ถ Show solution

Taking logs: $\log y = \log k + \log\left(b^x\right) = \log k + x\log b$.

This has the form $Y = c + mx$ with $Y = \log y$, constant intercept $c = \log k$ and constant gradient $m = \log b$, so it is a straight line.

For $y = ax^n$, $\log y = \log a + n\log x$, so plot $\log y$ against $\log x$ and look for a straight line.

Question 8

A cafรฉ records the hours of sunshine, $x$, and the number of cold drinks sold (in tens), $y$, on six days.

$x$3568911
$y$141921262733

(a) Find $r$. (b) Find the regression line of $y$ on $x$. (c) Estimate $y$ when $x = 10$.

โ–ถ Show solution

(a) Calculator: $r = 0.997$ โ€” very strong positive correlation.

(b) $a = 7.17$, $b = 2.31$, so $y = 7.17 + 2.31x$.

Check: $\bar{x} = 7$, $\bar{y} = 23.33$, and $7.167 + 2.3095 \times 7 = 23.33$ โœ“

(c) $y = 7.167 + 2.3095 \times 10 = 30.26$, i.e. about $303$ drinks. Interpolation, with $r$ close to $1$, so reliable.

Question 9

A graph of $\log_{10} y$ against $x$ is a straight line passing through $(0,\,1.25)$ and $(8,\,2.85)$. Find $y$ in the form $kb^x$.

โ–ถ Show solution

Gradient $= \dfrac{2.85 - 1.25}{8 - 0} = 0.2$; intercept $= 1.25$.

$\log_{10} y = 1.25 + 0.2x$

$k = 10^{1.25} = 17.8$, $b = 10^{0.2} = 1.58$, so $y = 17.8 \times 1.58^{x}$.

Question 10

The value, ยฃ$V$, of a model of car is recorded for cars aged $t$ years, $1 \leqslant t \leqslant 8$. The regression line of $\log_{10} V$ on $t$ is $\log_{10} V = 4.32 - 0.065t$, and the correlation coefficient between $\log_{10} V$ and $t$ is $-0.993$.

(a) Explain what the value $-0.993$ suggests about a model $V = kb^t$. (b) Find $k$ and $b$. (c) Interpret $k$ and $b$ in context. (d) Estimate the value of a $5$-year-old car. (e) Comment on using the model for a $20$-year-old car.

โ–ถ Show solution

(a) $\log_{10} V$ and $t$ have very strong negative linear correlation, so $\log_{10} V$ is close to linear in $t$ โ€” an exponential model $V = kb^t$ is appropriate.

(b) $k = 10^{4.32} = 20\,900$ (3 s.f.), $b = 10^{-0.065} = 0.861$ (3 s.f.).

(c) $k$: the model's value of a new car ($t = 0$) is about ยฃ$20\,900$ โ€” slightly outside the data, so approximate. $b$: each year the car keeps $86.1\%$ of its value, i.e. it loses about $13.9\%$ per year.

(d) $\log_{10} V = 4.32 - 0.325 = 3.995$, so $V = 10^{3.995} = 9886$, about ยฃ$9900$.

(e) $t = 20$ is well outside $1 \leqslant t \leqslant 8$: extrapolation. Older cars may hold their value (or become worthless/classic), so the estimate of about ยฃ$1050$ is unreliable.

Regression and Exponential Models · A Level Maths Year 2 · Created with MathJax