🏠 Home
Correlation & Regression
Unit IV · Lecture 28

BDS113 — Introduction to Statistics

Karl Pearson's Coefficient of Correlation

Simple Correlation · Formula · Properties · Coefficient of Determination · Worked Examples


Unit IV · Lecture 28 of 40 · B.Sc. Data Science, 1st Year, Semester II

Correlation & Regression
Unit IV · Lecture 28

The Journey — Lecture 28


📐
What is Correlation?
Definition · Types · Karl Pearson's contribution
📊
The Formula for r
Three equivalent forms · Step-by-step computation · Shortcut method
✏️
Worked Examples & Interactive Calculator
Step-by-step problems · Visual correlation · Coefficient of determination
⚖️
Properties, Interpretation & Quiz
Range · Symmetry · Invariance · Limitations · Practice quiz
Correlation & Regression
Unit IV · Lecture 28

🤔 What is Correlation?


📖 Formal Definition

Correlation is a statistical measure that quantifies the strength and direction of the linear relationship between two quantitative variables. The correlation coefficient is a single number that summarises this relationship.


💡 Analogy: The Dance Partners

Two dancers (variables) can move in sync (positive correlation), in opposite directions (negative correlation), or independently (no correlation). The correlation coefficient measures how well they synchronise — from −1 (perfect opposite) through 0 (no sync) to +1 (perfect sync).

📖 Karl Pearson (1857–1936)

Sir Karl Pearson was a British mathematician and biometrician who founded the field of mathematical statistics. He developed the product-moment correlation coefficient (now called Pearson's r) in the 1890s, building on work by Francis Galton. Pearson also founded the world's first university statistics department at University College London.


Positive (r > 0)

As x increases, y tends to increase. Height & weight.

Negative (r < 0)

As x increases, y tends to decrease. Price & demand.

Zero (r ≈ 0)

No linear relationship. Shoe size & IQ.

Correlation & Regression
Unit IV · Lecture 28

📊 Karl Pearson's Correlation Coefficient (r)


📖 The Formula — Three Equivalent Forms

r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √[Σ(xᵢ−x̄)² · Σ(yᵢ−ȳ)²]

Form 2 (Raw data — no deviations):

r = [nΣxy − Σx·Σy] / √{[nΣx² − (Σx)²] · [nΣy² − (Σy)²]}

Form 3 (Using covariance and standard deviations):

r = Cov(x,y) / (Sₓ · Sᵧ)    where   Cov(x,y) = Σ(xᵢ−x̄)(yᵢ−ȳ)/n


💡 Form 2 is the most practical for hand calculation — it uses raw sums (Σx, Σy, Σxy, Σx², Σy²) without needing to compute deviations. This is the formula you should use in exams.
Correlation & Regression
Unit IV · Lecture 28

🪜 Step-by-Step: Computing r


1Set up a table with columns: x, y, xy, x², y².
2Compute all sums: Σx, Σy, Σxy, Σx², Σy², and count n.
3Compute the numerator: nΣxy − Σx·Σy.
4Compute the denominator: √{[nΣx² − (Σx)²] · [nΣy² − (Σy)²]}.
5Divide: r = numerator / denominator.
6Interpret: Check sign (direction), magnitude (strength), and context.
Correlation & Regression
Unit IV · Lecture 28

✏️ Example 1: Computing r


📝 Problem

Find Karl Pearson's correlation coefficient for:

x12345
y24545

xyxyx²y²
12214
248416
3515925
44161616
55252525
1520665586

📖 Solution

n = 5, Σx = 15, Σy = 20, Σxy = 66, Σx² = 55, Σy² = 86

Numerator: nΣxy − Σx·Σy = 5(66) − (15)(20) = 330 − 300 = 30

Denominator:
nΣx² − (Σx)² = 5(55) − 225 = 275 − 225 = 50
nΣy² − (Σy)² = 5(86) − 400 = 430 − 400 = 30
√(50 × 30) = √1500 = 38.73

r = 30 / 38.73 = 0.7746


Result

r = 0.775

Moderate to strong positive correlation. As x increases, y tends to increase. About 60% of the variation in y is explained by the linear relationship with x (r² = 0.60).

Correlation & Regression
Unit IV · Lecture 28

✏️ Example 2: Study Hours vs Exam Score


📝 Problem

Find the correlation between study hours and exam scores:

Hours (x)23568
Score (y)5055657080

xyxyx²y²
25010042500
35516593025
565325254225
670420364900
880640646400
24320165013821050

📖 Solution

n = 5
Numerator: 5(1650) − (24)(320) = 8250 − 7680 = 570
Denominator: √{[5(138) − 576] · [5(21050) − 102400]}
  = √{[690 − 576] · [105250 − 102400]}
  = √{114 × 2850} = √324900 = 570.0

r = 570 / 570 = 1.000


Result

r = +1.000

Perfect positive linear correlation. All points lie exactly on a straight line. Study hours perfectly predict exam score in this dataset.

Correlation & Regression
Unit IV · Lecture 28

🎬 Interactive: Pearson's r Calculator






Correlation & Regression
Unit IV · Lecture 28

📐 Coefficient of Determination (r²)


📖 Definition

The coefficient of determination, r², measures the proportion of variance in y that is explained by the linear relationship with x. It is the square of the correlation coefficient.

r² = (explained variation) / (total variation)


rr²Interpretation
+1.0 or −1.01.00 (100%)Perfect linear fit — all variance explained
+0.9 or −0.90.81 (81%)Very strong — most variance explained
+0.7 or −0.70.49 (49%)Moderate — about half the variance explained
+0.5 or −0.50.25 (25%)Moderate — quarter of variance explained
+0.3 or −0.30.09 (9%)Weak — very little variance explained
00 (0%)No linear relationship

💬 Key Insight: If r = 0.7, then r² = 0.49. This means only 49% of the variation in y is explained by x. The remaining 51% is due to other factors or random variation. A correlation of 0.7 is often described as "strong," but it explains less than half the variance!
Correlation & Regression
Unit IV · Lecture 28

🔑 Properties of Pearson's r


Correlation & Regression
Unit IV · Lecture 28

⚖️ Interpreting the Value of r


|r| RangeStrengthTypical Description
0.00 – 0.19Very weakNegligible or no linear relationship
0.20 – 0.39WeakSome tendency, but unreliable for prediction
0.40 – 0.59ModerateNoticeable relationship, useful for rough prediction
0.60 – 0.79StrongGood linear relationship, useful for prediction
0.80 – 1.00Very strongExcellent linear relationship, reliable prediction

💬 Context matters! In physics, r = 0.95 might be considered mediocre (physical laws are very precise). In psychology or economics, r = 0.50 might be considered excellent (human behaviour is inherently variable). Always interpret r in the context of the field and the data.

💡 Probable Error of r

A classical test for significance: PE(r) = 0.6745(1−r²)/√n. If |r| > 6 × PE(r), the correlation is considered significant. If |r| < PE(r), it is not significant. Modern practice uses hypothesis testing (t-test) instead, but this formula appears in many textbooks.

Correlation & Regression
Unit IV · Lecture 28

🔑 Summary: Karl Pearson's r


Correlation & Regression
Unit IV · Lecture 28

🧠 Quick Quiz — Lecture 28


Q1: The range of Pearson's r is:

A) 0 to +1
B) −1 to +1
C) −∞ to +∞
D) 0 to ∞

Q2: If r = 0.8, then r² = 0.64 means:

A) 80% of variance is explained
B) 64% of variance in y is explained by x
C) The correlation is 64%
D) 36% of variance is explained

Q3: Pearson's r measures:

A) Only linear association
B) All types of association
C) Only positive association
D) Causal relationships

Q4: r(x,y) = 0.7. What is r(y,x)?

A) −0.7
B) 0.7
C) 0.49
D) Cannot be determined

Q5: If all points lie exactly on a line sloping downward, r equals:

A) +1
B) −1
C) 0
D) −∞

Q6: r = 0 for a U-shaped scatter. This means:

A) There is no relationship at all
B) There is no LINEAR relationship (but a non-linear one exists)
C) The data is perfectly correlated
D) The variables are independent
Correlation & Regression
Unit IV · Lecture 28

📝 Homework & Next Lecture


📝 Practice Tasks

1. Compute r for: x = 10, 20, 30, 40, 50 and y = 15, 25, 30, 40, 55.

2. Compute r for: x = 2, 4, 6, 8, 10 and y = 10, 8, 6, 4, 2. Interpret the result.

3. If r = 0.6 between advertising and sales, interpret r². What percentage of sales variation is NOT explained by advertising?

4. Explain why r is called "unit-free." Give an example.

5. Can r be misleading? Construct a dataset of 5 points where r ≈ 0 but the points clearly follow a U-shaped pattern.

6. BONUS: Show that if y = a + bx (perfect linear relationship with b > 0), then r = +1.


Upcoming

Lecture 29: Partial and Multiple Correlation — extending correlation to three or more variables.