Correlation and Regression
Line of Regression Equation

In the previous section, we used lines of regression by drawing these as accurately, by eye, as possible.

Here we will extend this and show how to use a formula to find the accurate line of regression.

If you have a set of paired data points (x_i, x_i) for which there is strong correlation (positive or negative), the problem is to find the line which best fits the data.

It may seem natural to try to find the line so that the points' distances from it have as small a total as possible, However, since the line will need to produce values of y for given values of x (or vice versa) it is more sensible to seek to produce a line so that any distances in the y direction, and therefore any errors in preparing y given x, should be a minimum.

If the line is to be used to predict values of y based on known values of x it is called the 'y on x' line and its equation is determined by making d_1^2 + d_2^2 + ... = \sum_{\ }^{\ } d^2 as small as possible. The equation of this line can be shown to be

y - \overline{y} = \frac{s_{xy}}{s_x^2}(x - \overline{x})

and for this line it can also be shown that ∑_{\ }^{\ } d^2 = ns_y^2(1 - r^2). You will notice that when r = ± 1 , (i.e. the points lie exactly on a straight line), then ∑_{\ }^{\ } d^2 = 0 as would be expected. The procedure used to obtain the equation is called the method of least squares and the 'd's are often referred to as residuals. The gradient is called the regression coefficient.

Worked Examples

1

Data obtained from an experiment in which different weights were attached to an elastic band and the length of the band measured, are given in the following table.

In the diagram opposite, the points lie very close to a straight line and the value of r is 0.999.

Show me

\overline{x} = \frac{1800}{8} = 225,\ \ \overline{y} = \frac{597}{8} = 74.625

s_{xy} = \frac{156150}{8} - 225 * 74.625 = 2728.125

s_x^2 = \frac{510000}{8} - 225^2 = 13125

⇒ y - 74.625 = \frac{2728.125}{13125}(x - 225)

⇒ y = 0.208x + 27.857

The values of 0.208 and 27.857 represent the gradient of the line and its intercept on the y-axis and are available directly from a calculator with LR mode. The gradient has units mm/g and tells us how much extension would be caused by the addition of 1 extra gram to the suspended mass. This line can now be used to find values of y given values of x.

2

Using the equation found in Worked Example 1, what length would you expect the elastic band to be if a weight of

(a)

375 g

Show me

When

x = 375 g,
y = 0.208 × 375 + 27.857
≈ 106 mm
(b)

1 kg

Show me

When

x = 1 kg = 1000 g,
y = 0.208 × 1000 + 27.857
≈ 236 mm
was attached to it?

Exercises

A student counted the number of words in an essay she had written, recording the total every 10 lines.

Find the formula to convert lines to words. How many words (approximately) has she written if she writes

(a)
65 lines
(b)
100 lines
(c)
1000 lines?

Eight test areas were given different concentrations of a new fertiliser and the resulting crop was weighed.

Write values rounded to 3 decimal places.

(a)

Draw a scatter diagram to show the data.

Calculate the equation of the regression line y on x.

y =
(b)

What increase in weight of crop might be expected from raising the concentration of fertiliser by 1 g/L?

Increase: kg

The experimental data below were obtained by measuring the horizontal distance y cm, rolled by an object released from the point P on a plane inclined at θ° to the horizontal, as shown in the diagram.

Illustrate the data by a scatter diagram.

(a)

Calculate the equation of the regression line of distance on angle and draw this line on the scatter diagram.

Write values rounded to 3 d.p.

y = θ +
(b)

It later emerged that one of the points was obtained using a different object. Suggest which point this was.

(, )
(c)

Estimate the distance the original object would roll if released at an angle of

(i)
12° cm
(ii)
40° cm

The variables H and T are known to be linearly related. Fifty pairs of experimental observations of the two variables gave the following results:

Σ H = 83.4 ,

Σ T = 402.0 ,

Σ HT = 680.2 ,

Σ H^2 = 384.6 ,

Σ T^2 = 3238.2

Obtain the regression equation from which one can estimate H when T has the value 7.8 and give, to 1 decimal place, the value of this estimate.

H = T −

H =