JC2 · H2 Mathematics · Study guide
Choose and fit regression models, use the mean point and residuals, transform variables, assess predictions and apply a fitted model.
Read the scatter diagram before trusting r
The product moment correlation coefficient r measures linear association between the two variables entered. A curved relationship may still have a large . Label axes with variables and units, look for curvature and unusual points, then choose the response variable and any transformation. An association in observational data does not establish cause and effect.
A regression line passes through the mean point
Find a missing assessment score
Five students have practice scores and assessment scores . The regression line of y on x is . Find k.
The mean point lies on the regression line:
The line is a model for the whole dataset. It need not pass through the observed point ; substituting x = 3 and claiming k = 5 would be wrong.
Fit the response on the predictor
Estimate in each direction
Use the completed data . Find both regression lines. Estimate y when x = 4, then estimate x when y = 6, treating neither score as a controlled independent variable.
The centred sums are:
For y on x, minimise vertical y residuals:
For x on y, minimise residuals in the x direction instead:
Rearranging the y-on-x line would give , a different estimate. Choose the regression direction from the prediction required when neither variable is clearly controlled. If the experiment identifies a controlled predictor, keep the fitted response-on-predictor model and interpret any reverse use within that model.
Both regression slopes are positive, agreeing with the sign of r. Their product is , not 1.
Residuals explain what least squares minimises
Calculate the minimum sum of squared residuals
For the same five score pairs, calculate the residuals from . Let for any line y = a + bx. Find a lower bound for S.
| x | Observed y | Predicted y | Residual |
|---|---|---|---|
| 1 | 2 | 2.4 | −0.4 |
| 2 | 5 | 3.7 | 1.3 |
| 3 | 3 | 5.0 | −2.0 |
| 4 | 8 | 6.3 | 1.7 |
| 5 | 7 | 7.6 | −0.6 |
Therefore , with equality for the least-squares line. It minimises the sum of squared vertical residuals. It does not make each residual zero.
Every line through has residual sum zero, because . Only one of those lines minimises the sum of squared residuals:
Change the slope while retaining the mean point
b = 1.3, a = 1.1: sum of residuals 0.00; sum of squared residuals 9.10. This is the least-squares fit.
A curved relationship needs the right transformed predictor
Growth that slows down
A plant’s heights h cm at ages t weeks are shown below. Compare with , then estimate its height at six weeks.
| t (weeks) | 1 | 2 | 4 | 8 | 16 |
|---|---|---|---|---|---|
| h (cm) | 3.0 | 6.6 | 9.8 | 13.5 | 16.7 |
Height increases at a decreasing rate. A straight line in t would impose a constant increase; a positive term would impose an increasing rate. Both proposed transformed models have the observed slowing shape, so compare their transformed correlations.
| Variables entered | r |
|---|---|
| 0.978472 | |
| 0.999749 |
The log model fits these data better. Put , regress h on u, then restore t:
For six weeks,
Six weeks lies in the data range 1–16 weeks and the correlation between h and is very strong. These support interpolation, assuming the same growth conditions. In the long run the model is unsuitable for a plant with a limiting height: grows without bound, although increasingly slowly.
The relevant r is between h and , not between h and t. A near-perfect transformed correlation does not prove that the model remains valid outside the observed ages.
Changing units in a transformed model
Rewrite the fitted plant model using age v in days, where v = 7t. Explain the effect on its correlation coefficient.
The transformed predictor differs only by a constant, so the correlation between h and the transformed predictor is unchanged. The intercept changes; the slope in front of the logarithm stays the same.
For ordinary variables, positive rescaling or adding a constant leaves r unchanged. Multiplying one variable by a negative constant reverses its sign. Replacing a variable with its square, reciprocal or logarithm can change r because that is not generally a linear change of the original variable.
Use the fitted model for a further calculation
Predict renovation time, then minimise estimated wages
The observed working days y for crews of x workers are shown below. A model , with a, b positive, is proposed. Fit it and find the crew size from 4 to 16 workers that minimises total wages at $120 per worker per day.
| Workers x | 4 | 6 | 8 | 10 | 12 | 16 |
|---|---|---|---|---|---|---|
| Working days y | 58 | 31 | 22 | 19 | 16 | 14 |
As the crew grows, completion time decreases more slowly toward a positive lower limit. A reciprocal-square model allows that limit; a decreasing logarithmic model would eventually predict negative working days. Regress y on :
The transformed correlation is . It is positive because y rises with , even though y decreases with x. For nine workers, the fitted time is about 20.1 days; this is interpolation within 4–16 workers.
Total estimated wages depend on both the crew size and duration:
The derivative is negative below this value and positive above it. Crew size is an integer, so compare the neighbouring integers:
| Workers | 8 | 9 |
|---|---|---|
| Estimated wages | $21640.10 | $21689.22 |
Hire eight workers under this fitted cost model. The estimate assumes all workers are paid for the modelled duration and ignores scheduling or productivity changes not represented in these data. Choosing the smallest predicted duration alone would not minimise wages.
An exponential model transforms the response
A decaying signal has measured strengths 101, 79, 65 and 51 units at times t = 0, 1, 2 and 3 s. Fit using linear regression on the logarithms, then predict its strength at 4 s.
Since all strengths are positive, take logarithms of the response:
Regress on t. The fitted line is
This predicts outside the observed range 0–3 s, so it is extrapolation and depends on the decay law continuing. The log fit minimises squared residuals in , not squared residuals in y. Do not compare those two sums as if they used the same response scale.
Before you finish
State exactly which transformed variables produced r. Pair each prediction with its data range and fit quality. Inspect unusual points before omitting them: an outlier is not automatically an error. Distinguish interpolation from extrapolation, and association from a causal conclusion. Preserve unrounded coefficients for predictions and squared-residual calculations.