A fitted line is useful only when it is understood. The slope and intercept have meanings in the original problem, and the closeness of the fit must also be measured. Both lines of regression and their link with the correlation coefficient complete the picture.

Regression Coefficients

The slope of the line of regression of y on x is the regression coefficient byx = r × (sy / sx) = sum of dx dy / sum of dx squared. For the line of x on y it is bxy = r × (sx / sy) = sum of dx dy / sum of dy squared. The line of y on x is y - mean of y = byx (x - mean of x), and the line of x on y is x - mean of x = bxy (y - mean of y). Both lines pass through the point formed by the two means.

Definition: Regression coefficient. The slope of a line of regression, giving the average change in the dependent variable for a unit change in the independent variable.

Properties

Both regression coefficients have the same sign as r. Their product equals r squared, so r = the square root of (byx × bxy), taking the sign of the coefficients. If one coefficient is greater than 1, the other must be less than 1. The arithmetic mean of the two coefficients is at least as large as r. The regression coefficients change with the scale of the variables, but not with a shift of origin.

Interpreting the Results

In the line y = 39.5 + 4.25x, the slope 4.25 means that, on average, each additional hour of study is associated with about 4.25 more marks. The intercept 39.5 is the estimated mark at zero hours, which may not be meaningful in practice. The square of the correlation coefficient, r squared, is the coefficient of determination. It is the proportion of the variation in y that is explained by the regression on x. Here r squared = 0.963, so about 96 percent of the variation in marks is explained by the hours of study.

Table 2.6: Correlation and regression compared

Aspect Correlation Regression
Purpose Strength of relation Estimation of one variable
Variables Treated alike Dependent and independent
Result Coefficient r Equation of a line
Symmetry r(x, y) = r(y, x) Two different lines

Example 2.5: Regression coefficients and r

Problem: For the hours-marks data, find byx, bxy and verify that their product equals r squared.

Solution:

  1. byx = sum of dx dy / sum of dx squared = 170 / 40 = 4.25.
  2. bxy = sum of dx dy / sum of dy squared = 170 / 750 = 0.2267.
  3. The product is 4.25 × 0.2267 = 0.9633, and r = 0.9815 so r squared = 0.9633.

Result: byx = 4.25 and bxy = 0.2267, and their product equals r squared, which is 0.963.

byx, bxy = 170 / 40, 170 / 750
print(round(byx, 4), round(bxy, 4), round(byx * bxy, 4))
print(round((byx * bxy) ** 0.5, 4))

Output

4.25 0.2267 0.9633
0.9815

Common mistakes

  • Using the line of y on x to estimate x from y. The line of x on y must be used.
  • Reporting the intercept as meaningful when x = 0 is outside the data.
  • Getting a product of the coefficients greater than 1, which shows a calculation error.

Key takeaways

  • byx = r (sy / sx) and bxy = r (sx / sy).
  • byx x bxy = r squared.
  • Both regression lines pass through (mean of x, mean of y).
  • r squared is the share of variation in y explained by x.

Practice questions

  1. State the relation between r and the regression coefficients.
  2. What does r squared = 0.81 mean?
  3. Through which point do both regression lines pass?

Answers to the practice questions

  1. r squared = byx x bxy, and r has the same sign as the coefficients.
  2. About 81 percent of the variation in y is explained by the regression on x.
  3. Through the point (mean of x, mean of y).

Sources

  • Official BCA syllabus Probability and Statistics, course code 26BCA403DS01, Unit II