Linear Regression – Straight Line Problems
Linear Regression – Straight Line Problems Linear regression is used to find the best-fitting straight line that shows the relationship between two variables. The general equation of a straight line: Y = a + b X Y = a + bX Y = a + b X Where: a = Intercept b = Slope (regression coefficient) Y = Dependent variable X = Independent variable 1️⃣ Example 1: Find Regression Equation (Y on X) 🔹 Question Find the regression equation of Y on X for the following data: X 1 2 3 4 5 Y 2 4 5 4 5 🔹 Step 1: Formula for Y on X Y = a + b X Y = a + bX Y = a + b X b = n ∑ X Y − ∑ X ∑ Y n ∑ X 2 − ( ∑ X ) 2 b = \frac{n\sum XY - \sum X \sum Y}{n\sum X^2 - (\sum X)^2} b = n ∑ X 2 − ( ∑ X ) 2 n ∑ X Y − ∑ X ∑ Y a = Y ˉ − b X ˉ a = \bar{Y} - b\bar{X} a = Y ˉ − b X ˉ 🔹 Step 2: Prepare Table X Y X² XY 1 2 1 2 2 4 4 8 3 5 9 15 4 4 16 16 5 5 25 25 Now compute totals: ∑ X = 15 \sum X = 15 ∑ X = 15 ∑ Y = 20 \sum Y = 20 ∑ Y = 20 ∑ X 2 = 55 \sum X^2 = 55 ∑ X 2 = 55 ∑ X...