Example of Linear Regression
The following data is a summary of pay. Calculate the regression equation.
| Sample | Grade | Weekly Salary |
|---|---|---|
| A | 4 | 400 |
| B | 5 | 600 |
| C | 5 | 800 |
| D | 6 | 700 |
| E | 7 | 800 |
| F | 9 | 900 |
In the summary below, the data in the Grade column is used for the x variable. The data in the Weekly salary column is used for y, but it is divided by 100 to simplify the calculations.
The data from above can be summarized in the table below:
| x | y | x2 | y2 | xy | |
|---|---|---|---|---|---|
| 4 | 4 | 16 | 16 | 16 | |
| 5 | 6 | 25 | 36 | 30 | |
| 5 | 8 | 25 | 64 | 40 | |
| 6 | 7 | 36 | 49 | 42 | |
| 7 | 8 | 49 | 64 | 56 | |
| 9 | 9 | 81 | 81 | 81 | |
| S | 36 | 42 | 232 | 310 | 265 |
The equation for linear regression is:
β1 = β0 + β1x + ε
To find the slope of the line:
| β1 = | Σxy - [(Σx)(Σy) / n] |
| Σx2 - [(Σx)2 / n] |
| β1 = | 265 - [(36)(42) / 6] |
| 232 - [(36)2 / 6] |
β1 = 0.8125
To find the y-intercept:
The regression line passes through the averages of the data, therefore, β0 equals:
ȳ = β0 + (0.8125)(x̄)
7 = β0 + (0.8125)(6)
β0 = 2.125
y = 2.125 + 0.8125x
Implication: If you know x, which in this case is the performance level, you can use the above regression model to find the appropriate salary(remembering to multiply the result by 100 as we divided by 100 to simplify the math).
Memory Jogger
Your assistant has determined that the regression model that best describes the relationship between performance (x) and salary (y) is:
y = 7.107 + 0.813x
How may this regression model be useful to you?