StudyVisuallyStart studying
Part 08 · Correlation and regression · Card 1 of 9

Correlation coefficient

The correlation r measures the strength and direction of a straight-line link between two numerical variables. It runs from -1 (perfect downhill line) to +1 (perfect uphill line). Zero means no straight-line link.

Last updated

Analogy

Tall parents tend to have tall children, but not always. Correlation puts a number on how closely the two go together.

Example

Computing r

x: 1,2,3,4,5 y: 2,4,5,4,5Means: 3 and 4Sum of dx x dy = 6Sxx = 10, Syy = 6r = 6 / square root of 60 = 0.77

In practice

Used to check whether study time, price or temperature moves with another measure.

Practice

Flashcards

  • What range can the correlation r take?From -1 to +1.

Interview questions

  • For the points (1,2), (2,4), (3,5), (4,4), (5,5), find the least squares line and R-squared.
    • Means 3 and 4
    • Slope Sxy / Sxx = 6 / 10 = 0.6
    • Intercept = 4 - 1.8 = 2.2
    • R-squared = 0.60
    • Residuals sum to zero

Questions people ask

What does a correlation of 0.77 mean?

It means a fairly strong uphill straight-line link: as x goes up, y tends to go up. It does not mean 77 percent of anything. Squaring r gives 0.6, the share of the variation in y explained by the line.

Can the correlation be zero when two variables are strongly related?

Yes. Correlation only detects straight-line links. A perfect U-shaped curve, such as y equals x squared over a symmetric range, can have r equal to zero. Always plot the data first rather than trusting r alone, because a single number can hide the shape of the data.