S1.4 - Correlation and regression

Syllabus
2019
Topic
S1.4
Level
AS

Learning objectives

Fit a least-squares regression line

A scatter diagram plots paired observations (x,y)(x,y) and reveals the direction, form and strength of their association. A linear regression line of yy on xx is the straight line used to model the average response yy for a given explanatory value xx.

y=a+bx,b=SxySxx,a=yˉbxˉy=a+bx,\qquad b=\frac{S_{xy}}{S_{xx}},\qquad a=\bar y-b\bar x

Calculate SxyS_{xy} and SxxS_{xx} from the data or supplied summaries, find bb, then use the means to find aa. The least-squares line passes through (xˉ,yˉ)(\bar x,\bar y); this gives a useful arithmetic check and a reliable point when drawing the line on the scatter diagram.

Suppose xˉ=4\bar x=4, yˉ=11\bar y=11, Sxx=20S_{xx}=20 and Sxy=30S_{xy}=30. Then b=30/20=1.5b=30/20=1.5 and a=111.5(4)=5a=11-1.5(4)=5, so the regression line isy=5+1.5x.y=5+1.5x.To draw it, calculate two fitted points within the plotted xx-range, join them with a straight line, and check that it passes through (4,11)(4,11).

The line of yy on xx minimises squared vertical residuals, so its direction matters: do not swap SxxS_{xx} for SyyS_{yy} or use it as a line of xx on yy. A scatter diagram can also show curvature or an influential outlier that a single straight line hides.

Use regression in the correct direction

In a regression of yy on xx, xx is the explanatory (independent) variable and yy is the response (dependent) variable. Substitute an observed-range value of xx to predict the corresponding yy; use a regression of xx on yy only when predicting xx from yy.

Decision Sound interpretation
gradient bb for each 1-unit increase in the explanatory variable, the predicted response changes by bb 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 aa predicted response at explanatory value 0, meaningful only if 0 is relevant to the data and context

For w=46.0+3.27hw=46.0+3.27h, where height hh is in cm and weight ww is in kg, a 1 cm increase in height corresponds to an average predicted increase of 3.273.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.5d=w/11.5 and a fitted line is w=3.46t+30.9w=-3.46t+30.9, then dividing every term by 11.5 gives d=0.301t+2.69d=-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.

Interpret the product moment correlation coefficient

The product moment correlation coefficient (PMCC), rr, measures the direction and strength of a linear association between two quantitative variables.

r=SxySxxSyy,1r1r=\frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}},\qquad -1\le r\le 1

Value of rr Linear pattern
close to +1+1 strong positive linear association
close to 1-1 strong negative linear association
close to 00 weak linear association; a non-linear relationship may still exist

If Sxy=91.55S_{xy}=-91.55, Sxx=445.57S_{xx}=445.57 and Syy=26.43S_{yy}=26.43, thenr=91.55445.57(26.43)=0.844 (approximately).r=\frac{-91.55}{\sqrt{445.57(26.43)}}=-0.844\ \text{(approximately)}.In context, larger values of one variable tend to occur with smaller values of the other. Because rr is fairly close to 1-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 rr; 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|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.