What is Correlation?
Correlation
Correlation is a statistical measure of the extent to which two variables are linearly related.
Positive, negative and zero correlation
Correlation compares how two variables move together. The measure is a coefficient, written r. It has no unit and lies between -1 and +1.
- Positive correlation. Both variables tend to increase together. The coefficient is above 0.
- Negative correlation. One tends to increase while the other decreases. The coefficient is below 0.
- Zero correlation. The coefficient is near 0. There is no linear relationship. A curved relationship can still exist.
The sign gives the direction. The size gives the strength. A value near 1 or -1 is a strong linear relationship, and a value near 0 is weak.
How to calculate r
The most common measure is the Pearson product-moment coefficient. Three sums of squares define it.
- SSxx is the sum of the squared deviations of x from its mean.
- SSyy is the same sum for y.
- SSxy is the sum of the products of the deviations of x and y.
The coefficient is r = SSxy / square root of (SSxx x SSyy). For the spread of each variable, see standard deviation and variance .
Worked example
OpenStax gives six pairs of practice hours (x) and points scored (y). They are 5 and 15, 7 and 22, 9 and 28, 10 and 31, 11 and 33, 12 and 36.
- The means are 9 hours and 27.5 points.
- SSxx = 34.
- SSyy = 301.5.
- SSxy = 101.
- r = 101 / square root of (34 x 301.5) = 101 / 101.25 = 0.9976.
The points lie close to a straight line that rises, so r is close to +1. The square of r is 0.995. A scatter plot confirms the pattern.
Is the correlation significant
A small sample can give a high r by chance. The test starts from the idea that the population coefficient is 0. The test statistic is t = r x square root of (n - 2) / square root of (1 - r squared). It has n - 2 degrees of freedom.
A shorthand says r is significant at about the 0.05 level when its size reaches 2 / square root of n. The limits are about 0.6325 for 10 observations, 0.3651 for 30 and 0.2000 for 100. For the example above, n = 6 gives 2 / 2.449 = 0.816. The value 0.9976 is far above it, and t = 28.6. The test assumes a well-designed random sample.
A significant r can still be small. With a large sample, a weak correlation can pass the test and be of little practical use.
What the number does not show
- Cause and effect. Correlation does not tell which variable drives the other, or whether either does. The judgment depends on the underlying science or engineering.
- Curved relationships. Correlation cannot describe a curvilinear relationship. For y = x squared with x from -3 to 3, the mean of x is 0, so r is exactly 0. Yet y depends fully on x.
- Outliers. The coefficient is skewed by outliers. One extreme point can make r look strong when the rest of the data shows little relationship.
- Too few points. A sample of five campsites is too small for a park with two thousand.
- A perfect value. A perfect correlation of 1 or -1 is rare. It can signal a data error.
Plot the data first. A scatter plot shows curved patterns and outliers that a single number hides.
Rank correlation
Spearman’s coefficient is Pearson’s r computed on ranks. Give the largest value rank 1, the next rank 2, and use average ranks for ties. It does not need a straight line. It works for any steady rise or fall, which is a monotonic relationship.
Example: take y = 2 to the power x, for x from 1 to 10. Y grows with x at every step, but not along a line. Pearson r is 0.80. Spearman is 1.0, because the ranks of x and y are identical.
Spearman is not for a relationship that rises and then falls. It also assumes independent observations.
In airfield documents
The word also appears in a non-statistical sense. FAA AC 150/5335-5D states that there is no mathematical correlation between the old ACN-PCN pavement strength reporting and the ACR-PCR system. The FAA means that no formula links the two reporting systems.
Frequently Asked Questions
- What is correlation?
- Correlation is a statistical measure of the extent to which two variables are linearly related. It is written as a coefficient r from -1 to +1. It has no unit and does not show cause and effect.
- What does a correlation coefficient of 0 mean?
- It means there is no linear relationship between the two variables. It does not rule out a curved relationship. For y = x squared on x from -3 to 3, r is exactly 0, yet y depends fully on x.
- What is the difference between positive and negative correlation?
- In a positive correlation, both variables tend to increase together. In a negative correlation, one tends to increase when the other decreases. The sign of r gives the direction, and the size of r gives the strength.
- Does correlation prove that one variable causes the other?
- No. JMP states that correlation does not tell about cause and effect. NIST adds that a scatter plot can never prove it. The judgment comes from the underlying science or engineering.
- How do you calculate a correlation coefficient?
- Compute r = SSxy divided by the square root of SSxx times SSyy. SSxy sums the products of the deviations from the two means. For hours and points scored in six pairs, r is 0.9976.
- When is a correlation statistically significant?
- It depends on the sample size. A shorthand says r is significant at about the 0.05 level when its size is at least 2 divided by the square root of n. For 10 observations that is 0.6325.
- When should Spearman be used instead of Pearson?
- Use Spearman when the relationship rises or falls steadily but not along a straight line. It is Pearson's r computed on ranks. For y = 2 to the power x, x from 1 to 10, Pearson r is 0.80 and Spearman is 1.0.
- What does correlation mean in airfield documents?
- The word can have a non-statistical sense. FAA AC 150/5335-5D says there is no mathematical correlation between the old ACN-PCN pavement strength reporting and the ACR-PCR system. The two systems are not linked by a formula.
References
- jmp-what-is-correlation
- What is Correlation? JMP Statistics Knowledge Portal (SAS Institute)
- jmp-correlation-coefficient
- Correlation coefficient JMP Statistics Knowledge Portal (SAS Institute)
- libretexts-shafer-zhang-10-2
- 10.2 The Linear Correlation Coefficient, Introductory Statistics (Shafer and Zhang) LibreTexts Statistics
- openstax-intro-stats-12-4
- 12.4 Testing the Significance of the Correlation Coefficient, Introductory Statistics OpenStax, Rice University
- openstax-intro-stats-12-2-scatter
- 12.2 Scatter Plots, Introductory Statistics 2e OpenStax, Rice University
- libretexts-openstax-13-2
- 13.2 The Correlation Coefficient r, Introductory Statistics 2e (OpenStax) LibreTexts Statistics
- nist-scatter-plot
- Scatter Plot, NIST/SEMATECH e-Handbook of Statistical Methods NIST
- libretexts-spearman
- 12.12 Spearman Rank Correlation, Math 40 Statistics and Probability Las Positas College, LibreTexts
- faa-ac-150-5335-5d
- AC 150/5335-5D, Standardized Method of Reporting Airport Pavement Strength: ACR-PCR FAA
This is a reference entry. TarmacView provides drone inspection services and doesn't sell the equipment or materials described in this glossary.