All subjects · Mathematics · WST01 (S1)

Using regression lines: prediction and coding

A regression line is only as good as the range of data behind it. You also need to convert a line found from coded data back to the original variables.

Interpolation and extrapolation

Example: data for x from 2 to 12. Predicting at x = 7 is fine; at x = 30 is extrapolation.

Sense checks

Check that a prediction makes sense in context. A negative mass, or a child's weight predicted to be an adult's, means extrapolation has failed or an arithmetic slip has occurred. Only use the line of y on x to predict y.

Coded regression lines

If the line was found for coded variables, substitute the codes and rearrange.

Example: q = 2.5 + 0.8p, with p = (x - 10)/2 and q = y/5.

y/5 = 2.5 + 0.8(x - 10)/2 = 2.5 + 0.4x - 4, so y/5 = 0.4x - 1.5 and y = 2x - 7.5.

The PMCC is unchanged by coding, but the regression coefficients do change.

Worked example

A regression line y = 12.4 + 0.65x is found for x from 20 to 60. Is a prediction at x = 85 reliable?

  1. 85 is outside the data range 20 to 60.
  2. This is extrapolation; the linear pattern may not continue.

Answer: No, it is unreliable (extrapolation).

Key idea: Interpolate, do not extrapolate; check predictions make sense; for coded lines, substitute the codes and rearrange.

Check yourself

  1. A regression line is calculated from data with x between 2 and 12. Which prediction is least reliable?
    • Predicting y when x = 7
    • Predicting y when x = 11
    • Predicting y when x = 30
    • Predicting y when x = 3
    Show answer

    Predicting y when x = 30. 30 is far outside the range of the data: extrapolation.

  2. A regression line for coded data is q = 2.5 + 0.8p, where p = (x - 10)/2 and q = y/5. Find the gradient of the regression line of y on x.
    Show answer

    2. y = 5(2.5 + 0.8(x - 10)/2) = 2x - 7.5, so the gradient is 2.

  3. For q = 2.5 + 0.8p with p = (x - 10)/2 and q = y/5, find the intercept of the regression line of y on x.
    Show answer

    -7.5. y = 2x - 7.5, so the intercept is -7.5.

  4. A coded regression line is t = 4 + 1.5s, where s = x - 100 and t = y - 200. Find y when x = 104.
    Show answer

    210. s = 4, t = 4 + 6 = 10, y = 210.

  5. The line y = 12.4 + 0.65x was found for x from 20 to 60. Predict y when x = 40.
    Show answer

    38.4. 12.4 + 26 = 38.4.

  6. A line of y on x is found from data on age (x) and reaction time (y). Can it be used to estimate age from a reaction time?
    • Yes, by rearranging the equation
    • No, the line of y on x should only be used to predict y
    • Yes, if the correlation is positive
    • Only when x = 0
    Show answer

    No, the line of y on x should only be used to predict y. Least squares in y minimises vertical residuals; it is not the best line for predicting x.

  7. A regression line predicts a negative mass for a newborn animal. What is the most likely reason?
    • The PMCC must be negative
    • Masses can be negative
    • The line passes through the origin
    • The prediction is an extrapolation beyond the data
    Show answer

    The prediction is an extrapolation beyond the data. Outside the data the linear model can give impossible values.

Practise with instant feedback

Sources

Last updated 7 November 2026. Spotted a mistake? Tell us.