CE Board Exam Randomizer

⬅ Back to Data Analytics Topics

Regression and Correlation

Linear regression fits a line $y=a+bx$ to paired data for estimation and prediction.

$$b=\frac{\sum (x-\bar{x})(y-\bar{y})}{\sum (x-\bar{x})^2}, \qquad a=\bar{y}-b\bar{x}$$

Linear Trend Prediction

Fit a line to points $(1,2)$, $(2,5)$, and $(3,7)$. Estimate $y$ when $x=4$.

Using least squares, $\bar{x}=2$ and $\bar{y}=14/3$.

$$b=2.5, \qquad a=\frac{14}{3}-2.5(2)=-0.333$$
$$y=-0.333+2.5x$$

At $x=4$, $y=9.67$.

Scroll to zoom