Maths Mathematics

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.
150155160165170175180185190-200-150-100-5050100150200xHeight (X) vs. Weight (Y) (r = 0.2)Perfect Positive (r = 1)Perfect Negative (r = -1)Observed Data (Example 1)
Correlation patterns: weak positive (r = 0.2), perfect positive, and perfect negative

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.
-5-4-3-2-112345-6-4-2246xyPerfect Positive (r = 1)Perfect Negative (r = -1)Strong Positive (r ≈ 0.8)Moderate Negative (r ≈ -0.6)
Four scatterplot patterns: perfect, strong, moderate, weak, and no correlation

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).
150155160165170175180185190455055606570758085Regression Line (Y = X - 105)Observed DataPredicted Data (Y')
Regression line fitted to height-weight data (Example 2)

Calculating the Regression Line

The slope () and intercept () are calculated using:

123456123456xyData points (x, y)Regression line (ŷ = 0.5x + 2)Observed data
Regression line fitted to data points (r = 0.98, strong positive)

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.

00.250.50.751Residual 10Residual 20Residual 30Residual 40Residual 50Residual (Y - Y')
Residuals for Example 3 (all zero in this case, indicating perfect fit)
123456123456xyRegression line (ŷ = 0.5x + 2)Observed dataPredicted values (ŷ)
Residuals (y - ŷ) shown as vertical arrows (e.g., +0.5 at x=5)

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)}

Explained Variation (r²) (4%)Unexplained Variation (1 - r²) (96%)
Variation explained by regression (r² = 0.04 for r = 0.2 in Example 1)

Applications of Correlation and Regression

  1. Economics: Predicting sales based on advertising spend.
  2. Biology: Studying the relationship between drug dosage and effectiveness.
  3. Engineering: Optimizing machine performance based on input variables.
  4. Agriculture: Estimating crop yield from rainfall data.
  5. Medicine: Analyzing the effect of exercise on heart rate.

Common Mistakes to Avoid

  1. 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.
  2. Ignoring Outliers: Outliers can heavily influence correlation and regression results.
  3. Misinterpreting r: A correlation of –0.9 is stronger than +0.3, even if both are "strong" in absolute terms.
  4. 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:

  1. Predict future sales based on past trends.
  2. Determine the relationship between advertising expenditure and sales revenue.
  3. Optimize pricing strategies based on demand elasticity.

Exam Tip

  1. Understand the Difference: Know when to use correlation (measuring relationship) vs. regression (prediction).
  2. Formulas: Memorize the formulas for r, b, and a. Practice calculations step-by-step.
  3. Interpretation: Always interpret the meaning of r and r² in context (e.g., "r = 0.9 means a strong positive correlation").
  4. Graphs: Draw scatterplots and regression lines to visualize relationships.
  5. Avoid Common Errors: Never assume causation from correlation. Check for outliers.
  6. Units: Ensure all units are consistent when calculating slopes and intercepts.
  7. Residuals: Understand that residuals help assess the fit of the regression line.

Practice Problems for NEB Exam:

  1. Calculate r for the following data:

    X Y
    1 2
    2 3
    3 5
    4 4
  2. Find the regression line for the data in Q1 and predict Y when X = 5.

  3. Explain why a correlation of –0.5 is weaker than a correlation of +0.9.

  4. What is the coefficient of determination, and how is it useful?

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