S1.4 - Correlation and regression
- Syllabus
- 2019
- Topic
- S1.4
- Level
- AS
A scatter diagram plots paired observations (x,y) and reveals the direction, form and strength of their association. A linear regression line of y on x is the straight line used to model the average response y for a given explanatory value x.
y=a+bx,b=SxxSxy,a=yˉ−bxˉ
Calculate Sxy and Sxx from the data or supplied summaries, find b, then use the means to find a. The least-squares line passes through (xˉ,yˉ); this gives a useful arithmetic check and a reliable point when drawing the line on the scatter diagram.
Suppose xˉ=4, yˉ=11, Sxx=20 and Sxy=30. Then b=30/20=1.5 and a=11−1.5(4)=5, so the regression line isy=5+1.5x.To draw it, calculate two fitted points within the plotted x-range, join them with a straight line, and check that it passes through (4,11).
The line of y on x minimises squared vertical residuals, so its direction matters: do not swap Sxx for Syy or use it as a line of x on y. A scatter diagram can also show curvature or an influential outlier that a single straight line hides.
In a regression of y on x, x is the explanatory (independent) variable and y is the response (dependent) variable. Substitute an observed-range value of x to predict the corresponding y; use a regression of x on y only when predicting x from y.
| Decision | Sound interpretation |
|---|---|
| gradient b | for each 1-unit increase in the explanatory variable, the predicted response changes by b response-units, on average |
| interpolation | the explanatory value lies within the observed range; prediction is usually more defensible |
| extrapolation | the explanatory value lies outside the observed range; the linear pattern may not continue |
| intercept a | predicted response at explanatory value 0, meaningful only if 0 is relevant to the data and context |
For w=46.0+3.27h, where height h is in cm and weight w is in kg, a 1 cm increase in height corresponds to an average predicted increase of 3.27 kg in weight. A height of 153 cm may be substituted if it lies within the recorded height range; a prediction at 170 cm is extrapolation if 170 lies beyond that range.
A linear change of variable must be undone before interpreting or reporting the original quantity. For example, if d=w/11.5 and a fitted line is w=−3.46t+30.9, then dividing every term by 11.5 gives d=−0.301t+2.69. Keep the named variables and their units visible through the rearrangement.
Regression describes association and average prediction, not a causal effect. Even an interpolation can be unreliable when the scatter is wide, the relationship is curved, or an outlier dominates; extrapolation adds the further risk that the relationship changes beyond the data.
The product moment correlation coefficient (PMCC), r, measures the direction and strength of a linear association between two quantitative variables.
r=SxxSyySxy,−1≤r≤1
| Value of r | Linear pattern |
|---|---|
| close to +1 | strong positive linear association |
| close to −1 | strong negative linear association |
| close to 0 | weak linear association; a non-linear relationship may still exist |
If Sxy=−91.55, Sxx=445.57 and Syy=26.43, thenr=445.57(26.43)−91.55=−0.844 (approximately).In context, larger values of one variable tend to occur with smaller values of the other. Because r is fairly close to −1, a negative linear model may be useful, but the scatter diagram should still be checked.
Adding a constant to either variable or multiplying it by a positive constant does not change r; multiplying one variable by a negative constant reverses the sign. This is why converting units by a positive linear coding preserves the strength and direction of correlation.
A large ∣r∣ does not prove causation or guarantee reliable predictions. PMCC measures only linear association and can be strongly affected by outliers, restricted ranges or mixed groups. Interpret it with the scatter diagram and context; derivations and significance tests are outside S1.4.