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:
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
🔹 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:
🔹 Step 3: Calculate b
🔹 Step 4: Calculate a
✅ Regression Equation
🔹 Step 5: Prediction Example
If X = 6, then:
2️⃣ Example 2: Find Both Regression Lines
🔹 Given:
| X | 10 | 20 | 30 | 40 |
|---|---|---|---|---|
| Y | 15 | 25 | 35 | 45 |
Observation
Notice:
So:
Regression of Y on X:
Regression of X on Y:
📌 Important Points for Exams
-
There are two regression lines:
-
Y on X
-
X on Y
-
-
Both lines pass through:
-
If correlation (r) = ±1 → both regression lines coincide.
-
Sign of regression coefficient is same as correlation coefficient.
Comments
Post a Comment