Skip to content
Skip to page content
soylai.com

Correlation — Notes

7 sections 7 min readBeta

1. Meaning and types of correlation

Correlation is the degree and direction of the linear relationship between two variables. It is positive when the variables move in the same direction (both rise and fall together) and negative when they move in opposite directions. It is linear when the dots of a scatter diagram lie around a straight line and non-linear when they follow a curve.

Imagined examples: temperature and cold drink sales at a juice corner (positive); temperature and hot soup sales at a hill stall (negative); shoe size and marks of students (no correlation).

Table of kinds of correlation, positive, negative, linear, non-linear and none, each with its meaning and an imagined example
KindMeaningImagined example
PositiveThe variables rise and fall togetherTemperature and cold drink sales at a juice corner
NegativeOne rises while the other fallsTemperature and hot soup sales at a hill stall
LinearThe dots lie around a straight lineHours of study and marks of a class
Non-linearThe dots follow a curveTemperature and electricity use in a hill town
NoneThe dots show no patternShoe size and marks of students

Key terms

Correlation

The degree and direction of the linear relationship between two variables.

Positive correlation

A relation in which the variables rise and fall together.

Negative correlation

A relation in which one variable rises as the other falls.

Linear correlation

A relation in which the paired values lie around a straight line.

2. Scatter diagram

A scatter diagram plots one dot for each pair of values, with one variable on each axis. It shows the direction of the relation (rising or falling) and its closeness (how near the dots lie to a line).

Perfect positive correlation puts all dots on a rising line (coefficient 1); perfect negative on a falling line (−1); high correlation puts the dots close to a line; low correlation spreads them; no correlation shows no pattern (about 0). In the imagined sets of seven dots drawn here the coefficients are 0.86, −0.86, 0.25 and 0.

Imagined pairs of values: positive, negative and no correlation
Imagined pairs of values: perfect positive, perfect negative and low correlation
Imagined sets of seven dots, as drawn in the figures.
DegreeThe dotsCoefficient
Perfect positiveAll on one rising straight line1
High positiveClose to a rising line0.86
Low positiveWidely spread, rising a little0.25
No correlationNo direction at all0
High negativeClose to a falling line−0.86
Perfect negativeAll on one falling straight line−1
Imagined Kaveripur district: wetter years go with higher yields. Axes start at 30 and 8.

Key terms

Scatter diagram

A graph with one dot for each pair of values of two variables.

Perfect correlation

A relation in which all dots lie exactly on one straight line, giving a coefficient of +1 or −1.

3. Correlation and causation

A high correlation does not prove that one variable causes the other. A third variable may affect both (in an imagined seaside town, hot weather raises both ice cream sales and sunburn: the coefficient for the imagined five months is 0.96), the link may be chance, or the direction of influence may be the reverse. A link caused by chance or by a third variable is a spurious correlation.

A third variable moves both
Table of three reasons why a strong correlation may not show cause: a third variable, chance and reverse direction, each with an imagined case
ReasonImagined case
A third variableHot weather raises both ice cream sales and sunburn in a seaside town
ChanceTwo unrelated series that happen to rise together over a few years
Reverse directionDo firms advertise more because sales are high, or are sales high because of advertising?

Key terms

Causation

A relation in which a change in one variable produces a change in the other.

Spurious correlation

A correlation between variables that arises from chance or from a common third factor and not from a real connection between them.

4. Properties of the coefficient

  1. It lies between −1 and +1.
  2. It has no unit.
  3. It is not affected by a change of origin or scale: adding the same number to every value, or multiplying or dividing every value by the same positive number, leaves it unchanged. Multiplying one variable by a negative number reverses its sign.
  4. A coefficient of 0 shows no linear relation; a curved relation may still exist (for the imagined temperature and electricity use of Himgiri the coefficient is 0 although the dots form a U).

For the imagined Lotus Valley data the coefficient is 0.8; after adding 2 to the hours it is 0.8, and after dividing the marks by 5 it is 0.8.

Table of the properties of the coefficient of correlation: limits, no unit, change of origin, change of scale, and sign and size
PropertyWhat it means
LimitsIt always lies between −1 and +1
No unitIt is a pure number, because the units of the two variables cancel
OriginAdding or subtracting the same number from every value does not change it
ScaleMultiplying or dividing every value by a positive number does not change it
Sign and sizeThe sign shows direction; the distance from zero shows strength
Imagined Lotus Valley School students. Only a negative multiplier reverses the sign.
Version of the dataCoefficient
Original hours and marks0.8
Hours increased by 20.8
Marks divided by 50.8
x = 10 × hours + 3 and y = marks ÷ 50.8
u = hours − 6 and v = (marks − 55) ÷ 50.8
Hours multiplied by −1−0.8
Imagined hill town: a strong curved relation with a coefficient of zero. Axes start at 8 and 0.
Imagined Himgiri figures: positive and negative products cancel.
TemperatureUse (units)x minus meany minus meanProduct of deviationsSquare of xSquare of y
1226-1210-120144100
1616-800640
2010-4-6241636
2480-80064
28104-6-241636
3216800640
36261210120144100
168112000448336

Key terms

Change of origin

Adding or subtracting the same number from every value of a variable.

Change of scale

Multiplying or dividing every value of a variable by the same number.

Non-linear relation

A relation in which the paired values follow a curve and not a straight line.

5. Karl Pearson's coefficient

r = Σxy ÷ √(Σx² × Σy²), where x and y are the deviations of the two series from their means. Work in a table of deviations, products and squares.

For the imagined Lotus Valley students: Σxy = 40, Σx² = 10, Σy² = 250, so r = 40 ÷ 50 = 0.8.

The actual-value form is r = (nΣxy − ΣxΣy) ÷ √[(nΣx² − (Σx)²)(nΣy² − (Σy)²)]; for the same data it gives 200 ÷ √(50 × 1250) = 0.8. The sign of Σxy is the sign of r.

Imagined Lotus Valley School students: means 6 and 55.
Hours (x)Marks (y)x minus meany minus meanProduct of deviationsSquare of xSquare of y
450-2-510425
545-1-10101100
65500000
765110101100
8602510425
30275004010250
Table of the symbols in Karl Pearson's formula: deviations x and y, the sum of products Σxy, the sums of squares Σx² and Σy², and the coefficient r
SymbolMeaning
xA value of the first variable minus the mean of the first variable
yA value of the second variable minus the mean of the second variable
ΣxyThe sum of the products of the paired deviations
Σx² and Σy²The sums of the squared deviations of each variable
rΣxy divided by the square root of Σx² times Σy²
Imagined Lotus Valley School students: the actual-value form gives the same coefficient.
QuantityWorkingValue
nNumber of pairs5
Σx and Σy4, 5, 6, 7, 8 and 50, 45, 55, 65, 60 added30 and 275
ΣxySum of each hours value times its marks value1690
Σx² and Σy²Sums of squares of the actual values190 and 15375
n Σxy − Σx Σy5 × 1690 − 30 × 275200
n Σx² − (Σx)²5 × 190 − 30²50
n Σy² − (Σy)²5 × 15375 − 275²1250
Coefficient200 ÷ √(50 × 1250)0.8
Imagined Mango Mart: means Rs 140 and 40 kg.
Price (Rs)Quantity (kg)x minus meany minus meanProduct of deviationsSquare of xSquare of y
12050-2010-200400100
13035-10-55010025
1404000000
150451055010025
1603020-10-200400100
70020000-3001000250
Imagined Mango Mart: higher prices go with smaller quantities. Axes start at 110 and 20.

Key terms

Karl Pearson's coefficient

A measure of the degree and direction of the linear relationship between two variables, equal to Σxy divided by the square root of Σx² times Σy², with deviations from the means.

Deviation

The difference between a value and the arithmetic mean of its series.

6. Spearman's rank correlation

rs = 1 − 6ΣD² ÷ (n³ − n), where D is the difference between the two ranks of an item and n is the number of items. Rank 1 is given to the highest value. It is used for qualitative data that can only be ranked and when extreme values are present. The differences D always add up to zero.

Repeated ranks: tied values get the average of the ranks they cover, and for each group of m tied items (m³ − m) ÷ 12 is added to ΣD²: rs = 1 − 6[ΣD² + Σ(m³ − m) ÷ 12] ÷ (n³ − n). Imagined examples: two judges of a debate give rs = 0.8; six students with one tied pair give ΣD² = 6.5, correction 0.5 and rs = 0.8.

The rank correlation route
Imagined batters: the tied score of 35 takes places 3, 4 and 5, so each gets 4.
PlayerScorePlace in orderRank
Player 14822
Player 2353–54
Player 3353–54
Player 46211
Player 52066
Player 6353–54
Imagined debate contestants. The differences always add to zero.
ContestantFirst judgeSecond judgeDD squared
Meera3211
Karan1100
Tara45-11
Imran23-11
Nisha5411
Total04
The factor is added to ΣD² once for every tied group.
Tied group of m itemsm cubed minus mCorrection factor
260.5
3242
4605
Imagined Sagar Coaching Institute students. One pair of equal Monday scores shares ranks 3 and 4.
StudentMondayFridayRank MondayRank FridayDD squared
172742200
265643.54-0.50.25
365573.55-1.52.25
480801100
558705324
650406600
Total6.5

Key terms

Rank correlation coefficient

A measure of the agreement between two rankings of the same items.

Correction factor

The amount (m³ − m) ÷ 12 added to ΣD² for each group of m items with repeated ranks.

7. Interpretation and choice of measure

As a rough guide, a value near +1 shows a very strong positive relation (for example +0.9), a value of about +0.3 a weak positive one, a value near 0 no linear relation, and a value such as −0.7 a fairly strong negative one. These bands are not fixed rules, and no value alone proves cause.

Use Karl Pearson's coefficient for exactly measured values and rank correlation for ranks, qualitative data and data with extreme values. For five imagined shops, one with very large sales, Karl Pearson's coefficient is 0.75 and rank correlation is 1.

A rough guide; the bands are not fixed rules. Neither sign nor size proves cause.
ValueA common reading
+1Perfect positive
+0.9Very strong positive
+0.3Weak positive
0No linear relation
−0.7Fairly strong negative
−1Perfect negative
Imagined shops with one very large sales figure.
PointKarl Pearson's coefficientRank correlation
DataMeasured valuesRanks, or qualitative data
UsesDeviations from the meansDifferences of ranks
Extreme valuesAffects it stronglyAffects it little
Imagined shops0.751
Imagined shops: one extreme value lowers Karl Pearson's coefficient but not the rank correlation. Axes start at 0 and 2.

Key terms

Extreme value

A value far from the others in a series, which can distort a measure based on deviations from the mean.

Exam tips

  • Define correlation as the degree and direction of the linear relationship between two variables.
  • Read a scatter diagram for direction and closeness; never claim that correlation proves cause.
  • The coefficient lies between −1 and +1, has no unit and ignores a change of origin and scale.
  • For Karl Pearson: formula first, then a table of deviations, products and squares, with column totals.
  • For rank correlation: rank from the highest, check that ΣD = 0, add (m³ − m) ÷ 12 for each tied group.
  • Finish every computation with a sentence on sign and strength.