First, the means of X and Y are separately calculated. Next, for each data
point, the value of X minus its mean is multiplied by the value of Y minus its
mean, and these products are summed. This is the numerator of Equation
(16.3), which is then divided by the sum of each value of X minus its mean
and squared. It is easy to see how Equation (16.3) will give an appropriate
average value for the slope. The first examples are for points that lie on
straight lines.
For a line with a slope of +1,asX increases by one unit from its mean,
the value of Y will also increase by one unit from its mean (and vice versa if
X decreases). The diff erence between any value of X and its mean will always
be the same as the difference between any value of Y and its mean, so the
numerator and denominator of Equation (16.3) will be the same thus giving
a b value of 1.0 (Figure 16.3(a)).
For a line with a slope of +3,asX increases by one unit from its mean,
the value of Y will increase by three units from its mean (and vice versa if X
decreases). Therefore, the value of the numerator of Equation (16.3) will
always be three times the size of the denominator, no matter how many
points are included, thus giving a b value of 3.0 (Figure 16.3(b)).
For a line with a slope of − 1,asX increases by one unit from its mean,
the value of Y will decrease by one unit from its mean (and vice versa if X
decreases). Therefore the numerator of Equation (16.3) will give a total that
is the same magnitude but the negative of the denominator, thus giving a b
value of –1.0 (Figure 16.3(c)).
For a line with a slope of − 3, as X increases by one unit from its mean,
the value of Y will decrease by three units from its mean (and vice versa if X
decreases), so the numerator of Equation (16.3) will always have a negative
sign and be three times the value of the denominator, thus giving a b value
of –3.0.
Finally,
for a line
running parallel to the X axis, every value of Y
i
Y
will be zero, so the total of the numerator of Equation (16.3) will also be
zero, thus giving a b value of zero (Figure 16.3(d)).
When the data are scattered, Equation (16.3) will also give the average
change in Y in relation to the increase in X. Figure 16.4 gives an example.
First, cases 16.4 (a), (b) and (c) show three lines, each of which has been
drawn through two data points. These lines have slopes of 3.0, 2.0 and 1.0
respectively, and the calculation of each b value is given in the box under the
graph. In Figure 16.4 (d) the six data points have been combined. Intuitively,
16.3 Calculation of the slope of the regression line 207