
This page includes Step-by-Step instructions to calculate a Least Squares linear regression equation by-hand. We will use the Temperature/Water example.
In order to find the regression equation “by-hand” we need some formulas.
|
Prediction Equation |
|
|
where |
|
|
|
|
|
|
|
Click here for formula explanation.
Click here for derivation of the intercept equation.
Example: Assume that during a three-hour period spent outside, a person recorded the temperature and their water consumption.
Use
the formulas to find the Least Squares Linear
Regression Equation (the line of best fit) for the temperature and the amount of water
consumed.
| Temperature (F) | Water Consumption (oz) |
| 99 |
48 |
| 85 | 27 |
| 97 | 48 |
| 75 | 16 |
| 92 | 32 |
| 85 | 25 |
| 83 | 20 |
|
C1 |
C2 |
C3 |
C4 |
C5 |
C6 |
||
|
X |
Y |
|
|
|
|
||
|
75 |
16 |
|
|
|
|
||
|
83 |
20 |
|
|
|
|
||
|
85 |
25 |
|
|
|
|
||
|
85 |
27 |
|
|
|
|
||
|
92 |
32 |
|
|
|
|
||
|
97 |
48 |
|
|
|
|
||
|
99 |
48 |
|
|
|
|
||
|
|
|
TOTAL |
|
|
|||
Preliminary Step
| Variable | Sample Mean | Sample Standard Deviation |
| x (temperature) |
88.00 | 8.47 |
| y (water consumption) |
30.86 | 12.76 |
Procedure ![]()
11. Use the slope to find the y-intercept.
y-intercept = b = (mean of y) - slope*(mean of x)
Learn the Procedure for calculating correlation coefficients
![]()
Simple Linear Regression Menu Dictionary