Straightening with a Square or a Reciprocal

The axis with r closest to 1 or −1 gives the model.

A line in the wrong variable

Six readings are (1, 13), (2, 7.1), (3, 4.9), (4, 4), (5, 3.5) and (6, 2.9). They fall steeply at first and then level off.

The regression line of y on x is y = 12.12 − 1.777x, and the product moment correlation coefficient is r = −0.8809. That is a strong correlation, but the residuals give the line away: the points lie above it at both ends and below it in the middle. Residuals in a pattern like that mean a straight line in x is the wrong shape.

Changing the horizontal axis

A model y = a + b/x is not a line in x, but it is a line in 1/x: writing u = 1/x turns it into y = a + bu, with gradient b and intercept a. So if the data follow y = a + b/x, the points (1/x, y) lie close to a straight line.

For these readings, 1/x takes the values 1, 0.5, 0.333, 0.25, 0.2 and 0.167. Against them, y has r = 0.9997.

1/xy

The six readings plotted against 1/x, with the regression line of y on 1/x.

Choosing by r

In the same way, y = a + bx² is a line in x², with gradient b and intercept a. To choose between y = a + bx, y = a + bx² and y = a + b/x, find r for y against each of x, x² and 1/x.

For these readings the three values are −0.8809, −0.7744 and 0.9997. The one closest to 1 or −1 is 0.9997, so y = a + b/x is the best of the three models.

The sign of r does not matter in the choice. For six points that fall faster and faster, such as (1, 19.4), (2, 18.1), (3, 15.4), (4, 12.1), (5, 7.6) and (6, 2), the values against x, x² and 1/x are −0.9776, −0.9999 and 0.7667. The closest to 1 or −1 is −0.9999, so y = a + bx² is the model, even though 0.7667 is the only positive value.

Reading the model off the line

The regression line of y on 1/x is y = 0.983 + 12.04 × (1/x). Its intercept is a and its gradient is b, so to 3 significant figures the model is y = 0.98 + 12.0/x.

To predict, put 1/x into the line, not x. At x = 8, 1/x = 0.125 and y = 0.98 + 12.0 × 0.125 = 0.98 + 1.5 = 2.48.

What r cannot tell you

r picks the best of the axes that were tried. If none of x, x² and 1/x suits the data, one of them still has the largest size of r. Drawing the scatter first shows which kinds of model are worth trying: a curve that levels off suggests 1/x, and one that bends away faster and faster suggests x².

The usual mistakes

Stopping at a high r for x. r = 0.9772 against x looks strong, but 0.9999 against x² is closer to 1, and the residuals from the line in x fall in a pattern.

Preferring a positive r. −0.9999 is closer to −1 than 0.7667 is to 1; the size of r decides, not its sign.

Putting x into the line for 1/x. With x = 8 the line needs 1/8 = 0.125, not 8.

Practice Straightening with a Square or a Reciprocal in the app