Scatter Diagrams and Regression Lines
Exploring relationships between variables and making predictions using the line of best fit
SPEC 2.2 • DATA PRESENTATION AND INTERPRETATION
Bivariate Data
Definition
Bivariate data consists of pairs of values (x, y) where each pair represents two related measurements from the same individual or item.
When we collect data on two variables simultaneously, we can investigate whether there is a relationship between them.
Examples of Bivariate Data:
Height and weight of people
Hours studied and exam score
Temperature and ice cream sales
Age of car and its value
Questions We Can Ask:
Is there a relationship?
How strong is it?
Can we predict one from the other?
What is the equation of the relationship?
Key Concept
Bivariate data is visualised using a scatter diagram - each point represents one pair of values.
Scatter Diagrams
A scatter diagram (or scatter plot) displays bivariate data as points on a coordinate grid.
Scatter diagram showing positive linear relationship
Tip
The dashed line is the regression line (line of best fit) - it shows the general trend in the data.
Explanatory and Response Variables
Explanatory Variable (x)
The independent variable that we believe influences or explains changes in the other variable.
Plotted on the horizontal axis.
Response Variable (y)
The dependent variable that responds to or is affected by changes in the explanatory variable.
Plotted on the vertical axis.
ContextExplanatory (x)Response (y)
Study habitsHours studiedExam score
AdvertisingAd spending (£)Sales revenue (£)
Plant growthAmount of fertiliserHeight of plant
Car depreciationAge of car (years)Value of car (£)
Important
The choice of which variable is explanatory depends on the context and what you're trying to investigate. Ask: "Which variable do I think influences the other?"
Types of Correlation
Correlation describes the strength and direction of a linear relationship between two variables.
Strong Positive
r close to +1
Weak Positive
r between 0 and +0.5
No Correlation
r close to 0
Strong Negative
r close to -1
Weak Negative
r between -0.5 and 0
Non-linear
r misleading here!
Important
Linear regression is only appropriate for data showing a linear pattern. Always plot your data first!
Correlation vs Causation
Key Principle
Correlation does NOT imply causation
Just because two variables show correlation, it does not mean one causes the other.
Two variables have a causal relationship if:
A change in one variable directly causes a change in the other.
Example: Ice cream sales & drownings
Strong positive correlation exists, but ice cream doesn't cause drowning!
Third variable: Hot weather increases both ice cream sales AND swimming (leading to more drownings)
Reasons correlation ≠ causation:
Confounding variable - a third factor affects both
Reverse causation - the effect causes the cause
Coincidence - no real relationship
Sampling issues - biased or small sample
Exam Tip
When asked to comment on whether data shows a causal relationship, consider: context, whether there could be confounding variables, and whether the sample is appropriate (random, large enough).
01Worked Example - Plotting Data
The table shows the number of hours spent revising (x) and the exam score (y) for 6 students.
Hours (x)2457810
Score (y)354552606875
(a) State the explanatory and response variables.
(b) Describe the relationship shown.
a)
Explanatory (x): Hours spent revising - this is what we control/change
Response (y): Exam score - this is what we measure as a result
positive linear relationship
Worked Example - Identifying Variables02
A researcher investigates the relationship between the age of a car and its resale value. Which variable should be the explanatory variable? Justify your answer.
1
The age of the car should be the explanatory variable (x).
2
Justification: The age of a car influences its value, not the other way around. As time passes, cars depreciate in value. We cannot change a car's value to make it older or younger.
3
The resale value is the response variable (y) because it responds to (is affected by) the age.
Expected relationship: Negative correlation - as age increases, value decreases.
The Regression Line
Definition
The regression line of y on x is the line that minimises the sum of squared residuals:
Least Squares Method
Residual:
We minimise:
Setting and gives:
Key Point
The regression line always passes through . The formulas minimise the total squared vertical distance from points to the line.
Equation of the Regression Line
Formula
b = gradient (slope) of the linea = y-intercept (value of y when x = 0)
Calculating the Coefficients
Remember
The formulas for and are:
Tip
Always calculate b first, then use it to find a. The line must pass through .
Worked Example - Calculating Sxy and Sxx03
For the data: n = 8, Σx = 40, Σy = 120, Σx² = 240, Σxy = 680. Calculate Sₓₓ and S_xy.
1
Calculate :
2
Calculate :
Answer: Sₓₓ = 40, S_xy = 80
Worked Example - Finding Regression Equation04
Using the values from Example 3 (n = 8, Σx = 40, Σy = 120, Sₓₓ = 40, S_xy = 80), find the equation of the regression line y on x.
1
Calculate the means:
2
Calculate b (gradient):
3
Calculate a (y-intercept):
Regression equation: y = 5 + 2x
Interpreting a and b
Gradient (b)
The gradient tells you how much y changes for each unit increase in x.
Interpretation: "For every 1 unit increase in [x variable], the [y variable] increases/decreases by b units on average."
Y-intercept (a)
The y-intercept is the predicted value of y when x = 0.
Interpretation: "When [x variable] is zero, the predicted [y variable] is a units."
Caution
The y-intercept may not always have a meaningful interpretation:
If x = 0 is outside the range of data, interpreting a may be extrapolation
Sometimes x = 0 is impossible (e.g., "0 hours of sunlight" for plant growth)
Example Interpretation
For y = 5 + 2x where x = hours studied and y = exam score:
b = 2: Each additional hour of study increases the predicted exam score by 2 marks
a = 5: A student who studies 0 hours would be predicted to score 5 marks
05Worked Example - Interpretation
A company finds the regression line for advertising spend (x, in £1000s) and weekly sales (y, in £1000s) is: y = 12 + 3.5x
Interpret the values of the gradient and y-intercept in context.
1
Gradient (b = 3.5):
For every additional £1000 spent on advertising, the weekly sales are predicted to increase by £3500 on average.
2
Y-intercept (a = 12):
When no money is spent on advertising (x = 0), the predicted weekly sales are £12,000. This represents the baseline sales without advertising.
3
Note: The y-intercept has a sensible interpretation here because a company could genuinely have zero advertising spend.
Using the Regression Line
The regression line can be used to predict values of y for given values of x.
Interpolation
Making predictions within the range of the original data.
Generally reliable
Extrapolation
Making predictions outside the range of the original data.
Potentially unreliable
Important
Extrapolation assumes the linear relationship continues beyond the data - this may not be true!
06Worked Example - Prediction
The regression line for temperature (x °C, range 10-30) and ice cream sales (y, in hundreds) is: y = 0.5 + 0.8x
(a) Predict sales when temperature is 25°C
(b) Would it be appropriate to use this equation to predict sales at 40°C?
a)
Substitute x = 25 into y = 0.5 + 0.8x: Predicted sales: 2050 ice creams
This is interpolation (25°C is within range 10-30°C), so it's reliable.
b)
No, this would not be appropriate. 40°C is outside the data range (10-30°C), so this is extrapolation which is unreliable.
Limitations of Regression
When Regression May Be Inappropriate
Non-linear relationships: If the scatter diagram shows a curve, a linear model is inappropriate
Outliers: Extreme values can distort the regression line significantly
Extrapolation: Predictions outside the data range are unreliable
No causal relationship: Correlation does not imply causation
Remember
Correlation ≠ Causation. Just because two variables are correlated doesn't mean one causes the other. There could be a third variable affecting both, or it could be coincidence.
Calculator: Linear Regression
Setup & Data Entry
1. Press MODE → 2 (STAT) → 2 (A+BX)
2. Enter data pairs: [x] = [y] =
Example: For (2, 35): Press 2 = 35 =
Getting Results
1. Press SHIFT → 1 (STAT)
2. Select 5 (Reg) for regression menu
3. Choose: 1=A, 2=B, 3=r
Key Statistics
OptionSymbolMeaning1Ay-intercept (a)2BGradient (b)3rCorrelation coefficient
Casio fx-83GT CW
Exam Tip
Always show your formula substitutions even when using calculator results. Write: "Using calculator: a = ..., b = ..." then state your equation.
Exponential Models
When data shows a non-linear pattern, we can use logarithms to transform it into a linear relationship.
Power Model: y = axⁿ
Taking logs of both sides:log y = log a + n log xCode using: Y = log y and X = log x
Gives linear form: Y = log a + nX
Exponential Model: y = kbˣ
Taking logs of both sides:log y = log k + x log bCode using: Y = log y and X = x
Gives linear form: Y = log k + (log b)X
Finding Constants from Coded Data
For y = axⁿ:
Intercept of Y on X gives log a → a = 10^intercept
Gradient gives n directlyFor y = kbˣ:
Intercept gives log k → k = 10^intercept
Gradient gives log b → b = 10^gradient
How to Identify the Model
If coded with X = log x, Y = log y → Power model (y = axⁿ)
If coded with X = x, Y = log y → Exponential model (y = kbˣ)
07Worked Example - Exponential Model
Data are coded using X = t and Y = log g. The regression line of Y on X is found to be Y = -0.2215 + 0.0792X.
(a) State whether the relationship is of the form y = axⁿ or y = kbˣ.
(b) Find the values of the constants in the original model.
a)
Since X = t (not log t) and Y = log g, this is an exponential model: g = kb^t
b)
Finding k: The intercept is log k = -0.2215
k = 10^-0.2215 = 0.600 (3 s.f.)
•
Finding b: The gradient is log b = 0.0792
b = 10^0.0792 = 1.20 (3 s.f.)
Model: g = 0.600 × 1.20^t
08Worked Example - Power Model
The relationship between pressure P and volume V is modelled as P = aVⁿ. Data are coded using X = log V and Y = log P. The regression line of Y on X is: Y = 2.4 - 1.4X
(a) Explain why coding X = log V and Y = log P confirms this is a power model.
(b) Find the values of a and n.
a)
For P = aVⁿ, taking logs: log P = log a + n log V
With Y = log P and X = log V, this gives Y = log a + nX
This matches the linear form Y = c + mX, confirming a power model.
b)
Finding n: The gradient equals n
n = -1.4
•
Finding a: The intercept is log a = 2.4
a = 10^2.4 = 251 (3 s.f.)
Model: P = 251V^-1.4
Practice
Question 1: Given: n = 10, Σx = 50, Σy = 200, Σx² = 300, Σxy = 1200
(a) Calculate Sₓₓ and S_xy
(b) Find the equation of the regression line y on x
(c) Predict y when x = 7
a)
b)
y = 4x
c)
Practice
Question 2: The regression line for engine size (x litres) and fuel consumption (y mpg) is: y = 55 - 8x
The data was collected from cars with engine sizes between 1.0 and 3.0 litres.
(a) Interpret the gradient in context.
(b) Interpret the y-intercept and comment on its validity.
(c) Would it be reliable to use this equation to predict the fuel consumption of a car with a 5.0 litre engine? Explain.
a)
For each additional litre of engine size, fuel consumption decreases by 8 mpg on average.
b)
When engine size is 0 litres, predicted consumption is 55 mpg. This is NOT valid as a car cannot have 0 litre engine - extrapolation beyond data range.
c)
No - this is extrapolation (5.0L is outside 1.0-3.0L range). The linear relationship may not hold for very large engines.
Practice
Question 3: A biologist collects data on the age (x months) and mass (y grams) of a species of fish. She calculates the regression line as y = 15 + 12x for fish aged 2-10 months.
(a) Predict the mass of a fish aged 6 months. Is this prediction reliable?
(b) A student uses the equation to predict that a fish aged 50 months would have mass 615g. Explain why this prediction is inappropriate.
a)
y = 15 + 12(6) = 15 + 72 = 87 grams
This is reliable as 6 months is within the data range (2-10 months) - interpolation.
b)
This is extrapolation (50 months far outside 2-10 month range).
Fish don't grow linearly forever - growth typically slows or stops at maturity. The linear model only applies to young, growing fish. 615g may be biologically impossible for this species.
Summary
Key Concepts
ConceptDescription
Explanatory variable (x)The independent variable that influences the response
Response variable (y)The dependent variable that responds to changes in x
Regression liney = a + bx, line of best fit minimising squared residuals
Gradient (b)Change in y for each unit increase in x
InterpolationPrediction within data range - reliable
ExtrapolationPrediction outside data range - unreliable
Key Formulas
and
where and
Exam Skills
Always interpret coefficients in context
State whether prediction is interpolation or extrapolation
Explain why extrapolation is unreliable with context-specific reasons
Next: Bivariate Data