The following supplemental notes were created by Dr. Maria Tackett for STA 210. They are provided for students who want to dive deeper into the mathematics behind regression and reflect some of the material covered in STA 211: Mathematics of Regression. Additional supplemental notes will be added throughout the semester.
This document contains the mathematical details for deriving the least-squares estimates for slope () and intercept (). We obtain the estimates, and by finding the values that minimize the sum of squared residuals, as shown in Equation 1.
Recall that we can find the values of and that minimize /eq-ssr by taking the partial derivatives of Equation 1 and setting them to 0. Thus, the values of and that minimize the respective partial derivative also minimize the sum of squared residuals. The partial derivatives are shown in Equation 2.
The derivation of deriving is shown in Equation 3.
The derivation of using the we just derived is shown in Equation 4.
To write in a form that’s more recognizable, we will use the following:
where is the covariance of and , and is the sample variance of ( is the sample standard deviation).
Thus, applying Equation 5 and Equation 6, we have
The correlation between and is . Thus, . Plugging this into Equation 7, we have