Posts

Multiple Linear Regression – Problem & Solution

  Multiple Linear Regression – Problem & Solution Multiple Linear Regression explains the relationship between one dependent variable (Y) and two or more independent variables (X₁, X₂, …) . The general form: Y = a + b 1 X 1 + b 2 X 2 Y = a + b_1 X_1 + b_2 X_2 Y = a + b 1 ​ X 1 ​ + b 2 ​ X 2 ​ Where: a = Intercept b₁, b₂ = Partial regression coefficients 🔢 Example Problem (Two Independent Variables) 🔹 Question Fit the regression equation: Y = a + b 1 X 1 + b 2 X 2 Y = a + b_1 X_1 + b_2 X_2 Y = a + b 1 ​ X 1 ​ + b 2 ​ X 2 ​ Given data: Obs X₁ X₂ Y 1 1 2 4 2 2 1 3 3 3 4 8 4 4 3 7 ✅ Step 1: Model Y = a + b 1 X 1 + b 2 X 2 Y = a + b_1 X_1 + b_2 X_2 Y = a + b 1 ​ X 1 ​ + b 2 ​ X 2 ​ We use Normal Equations : ∑ Y = n a + b 1 ∑ X 1 + b 2 ∑ X 2 \sum Y = na + b_1\sum X_1 + b_2\sum X_2 ∑ Y = na + b 1 ​ ∑ X 1 ​ + b 2 ​ ∑ X 2 ​ ∑ X 1 Y = a ∑ X 1 + b 1 ∑ X 1 2 + b 2 ∑ X 1 X 2 \sum X_1Y = a\sum X_1 + b_1\sum X_1^2 + b_2\sum X_1X_2 ∑ X 1 ​ Y = a ∑ X 1 ​ + b 1 ​ ∑ ...

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...