MathematicsUnit 1112 min read
Correlation & Regression: Scatterplots, Lines, and Predictions
Unit 11 of Mathematics explains how to measure relationships between two variables (correlation) and how to predict one variable from another (regression), with real-world applications, formulas, and NEB-style problems.
TAKEAWAYS:
- Correlation measures how two variables move together (positive, negative, or no relationship).
- Regression finds the best-fit line to predict values (linear regression is most common).
- Pearson’s r quantifies correlation strength (–1 to +1), while r² shows how much variation is explained.
- Least squares method minimizes errors to find the regression line’s slope and intercept.
- Residuals help check how well the model fits the data.
- Applications include economics, biology, and engineering for forecasting and decision-making.
What is Correlation?
Correlation studies how two variables change together. For example:
- Height vs. Weight: As height increases, weight usually increases → positive correlation.
- Study Hours vs. Exam Scores: More study time → higher scores → positive correlation.
- Ice Cream Sales vs. Temperature: Higher temperature → more ice cream sold → positive correlation.
- Rainfall vs. Sunburn Cases: More rain → fewer sunburns → negative correlation.
Types of Correlation
- Positive Correlation (r > 0): Both variables increase together.
- Negative Correlation (r < 0): One increases as the other decreases.
- No Correlation (r ≈ 0): No clear relationship.
Measuring Correlation: Pearson’s Correlation Coefficient (r)
Pearson’s r measures the strength and direction of a linear relationship: Where:
- = number of data points,
- = sum of the product of paired scores,
- and = sums of X and Y,
- and = sums of squared X and Y.
Example 1: Calculate r for Height (X) and Weight (Y)
| Height (X) | Weight (Y) | XY | X² | Y² |
|---|---|---|---|---|
| 150 | 50 | 7500 | 22500 | 2500 |
| 160 | 55 | 8800 | 25600 | 3025 |
| 170 | 60 | 10200 | 28900 | 3600 |
| 180 | 65 | 11700 | 32400 | 4225 |
| 190 | 70 | 13300 | 36100 | 4900 |
| Calculations: |
- ,
- ,
Correction: The calculation above has an error. Let’s re-calculate carefully: Mistake Identified: The values in the table are unrealistic (e.g., height 150 cm for a 12th grader is too short). Let’s use realistic data:
Revised Example:
| Height (X) | Weight (Y) | XY | X² | Y² |
|---|---|---|---|---|
| 160 | 55 | 8800 | 25600 | 3025 |
| 165 | 60 | 9900 | 27225 | 3600 |
| 170 | 65 | 11050 | 28900 | 4225 |
| 175 | 70 | 12250 | 30625 | 4900 |
| 180 | 75 | 13500 | 32400 | 5625 |
Calculations:
- ,
- ,
Interpretation: A weak positive correlation (r = 0.2) exists between height and weight in this data.
What is Regression?
Regression finds the best-fit line (or curve) to predict one variable (dependent variable, Y) from another (independent variable, X). The linear regression equation is: Where:
- = y-intercept (value of Y when X = 0),
- = slope (change in Y for a unit change in X).
Calculating the Regression Line
The slope () and intercept () are calculated using:
Example 2: Find the Regression Line for Height (X) and Weight (Y) Using the same data as above:
- , , ,
- , .
Calculate slope (b):
Calculate intercept (a):
Regression Equation:
Prediction: If height (X) is 170 cm, predicted weight (Y) is:
Residuals and Goodness of Fit
Residuals are the differences between observed Y values and predicted Y values: A good regression line has small residuals.
Example 3: Calculate Residuals Using the regression line :
| Height (X) | Weight (Y) | Predicted Y | Residual (Y - Y') |
|---|---|---|---|
| 160 | 55 | 55 | 0 |
| 165 | 60 | 60 | 0 |
| 170 | 65 | 65 | 0 |
| 175 | 70 | 70 | 0 |
| 180 | 75 | 75 | 0 |
Observation: In this case, the line fits perfectly (residuals = 0), which is rare in real data.
Coefficient of Determination (r²)
r² (R-squared) measures how much of the variation in Y is explained by X: From Example 1 (corrected), , so: r^2 = (0.2)^2 = 0.04 \quad \text{(4% of variation in Y is explained by X)}
Applications of Correlation and Regression
- Economics: Predicting sales based on advertising spend.
- Biology: Studying the relationship between drug dosage and effectiveness.
- Engineering: Optimizing machine performance based on input variables.
- Agriculture: Estimating crop yield from rainfall data.
- Medicine: Analyzing the effect of exercise on heart rate.
Common Mistakes to Avoid
- Assuming Causation: Correlation does not imply causation. Just because two variables are correlated does not mean one causes the other.
- Example: Ice cream sales and drowning incidents both increase in summer, but ice cream does not cause drowning.
- Ignoring Outliers: Outliers can heavily influence correlation and regression results.
- Misinterpreting r: A correlation of –0.9 is stronger than +0.3, even if both are "strong" in absolute terms.
- Extrapolating Beyond Data Range: Predicting values far outside the observed X range can be unreliable.
NEB-Style Questions and Solutions
Question 1: Short Answer
Define correlation and regression. Give one example of each. Solution:
- Correlation: A statistical measure that expresses the extent to which two variables are related (e.g., height and weight).
- Regression: A method to find the best-fit line to predict one variable from another (e.g., predicting exam scores from study hours).
Question 2: Calculation
Given the following data, calculate Pearson’s correlation coefficient (r):
| X | Y |
|---|---|
| 2 | 5 |
| 4 | 7 |
| 6 | 9 |
| 8 | 11 |
Solution:
| X | Y | XY | X² | Y² |
|---|---|---|---|---|
| 2 | 5 | 10 | 4 | 25 |
| 4 | 7 | 28 | 16 | 49 |
| 6 | 9 | 54 | 36 | 81 |
| 8 | 11 | 88 | 64 | 121 |
- ,
- ,
Answer: (perfect positive correlation).
Question 3: Regression Line
Find the regression line for the data in Question 2. Solution: Using the same data: Regression Equation: or .
Question 4: Interpretation
What does an r value of –0.8 indicate? Solution: An r value of –0.8 indicates a strong negative correlation between the two variables. As one variable increases, the other decreases significantly.
Question 5: Real-World Application
How can regression be used in business? Solution: Regression can be used in business to:
- Predict future sales based on past trends.
- Determine the relationship between advertising expenditure and sales revenue.
- Optimize pricing strategies based on demand elasticity.
Exam Tip
- Understand the Difference: Know when to use correlation (measuring relationship) vs. regression (prediction).
- Formulas: Memorize the formulas for r, b, and a. Practice calculations step-by-step.
- Interpretation: Always interpret the meaning of r and r² in context (e.g., "r = 0.9 means a strong positive correlation").
- Graphs: Draw scatterplots and regression lines to visualize relationships.
- Avoid Common Errors: Never assume causation from correlation. Check for outliers.
- Units: Ensure all units are consistent when calculating slopes and intercepts.
- Residuals: Understand that residuals help assess the fit of the regression line.
Practice Problems for NEB Exam:
Calculate r for the following data:
X Y 1 2 2 3 3 5 4 4 Find the regression line for the data in Q1 and predict Y when X = 5.
Explain why a correlation of –0.5 is weaker than a correlation of +0.9.
What is the coefficient of determination, and how is it useful?
A company finds that r = 0.7 between employee training hours (X) and productivity (Y). What does this mean?
Good luck with your NEB exam preparation! 🚀
Based on the NEB +2 Science syllabus for Mathematics (Maths), unit 11.
Discussion
Loading…