Before you can make sense of how two variables relate to each other in psychological research, you need to understand the mathematical machinery working behind the scenes. Pearson’s product moment correlation coefficient – the most widely used measure of linear association between two continuous variables – doesn’t emerge from thin air. It is built on three core statistical concepts: the mean, variance, and covariance. Get these three right, and the logic of correlation becomes clear and intuitive.
Table of Contents
- Why these building blocks matter
- The mean: your starting point
- Variance: measuring spread within a single variable
- What variance tells you
- Covariance: when two variables move together
- Interpreting the sign of covariance
- The limitation of covariance
- From covariance to Pearson’s r
- What the values of r mean
- How the three concepts connect
- A note on what correlation does not tell you
Why these building blocks matter
In psychological research, we are constantly asking questions like: Does anxiety increase as workload increases? Do people who sleep more perform better on memory tasks? To answer these questions quantitatively, we need a method that can measure both the direction and strength of a relationship between two variables. Pearson’s r, developed by Karl Pearson in the early 1900s, does exactly that – but its formula is anchored in mean, variance, and covariance. Understanding each concept individually is what makes the full formula interpretable rather than just a set of symbols to memorize.
The mean: your starting point
The mean is the arithmetic average of a dataset – the sum of all values divided by the number of observations. It seems simple, but it plays a pivotal role in correlation analysis. Every other calculation in Pearson’s r depends on it.
In correlation, you are working with two variables simultaneously – call them X and Y. Each variable has its own mean (often written as Xฬ and ศฒ). These means act as reference points. Every data point is eventually compared against its variable’s mean to produce what statisticians call a deviation score – the difference between an individual value and the group average.
For example, if five students score 60, 65, 70, 75, and 80 on a test, the mean is 70. A student who scored 80 has a deviation score of +10; one who scored 60 has a deviation score of โ10. These deviations tell you how far each observation sits from the center of the data. Without calculating means first, there is no way to proceed with variance or covariance.
Variance: measuring spread within a single variable
Variance is a measure of how spread out the data points are around the mean. More precisely, it is the average of the squared deviations from the mean. The squaring step is essential – it prevents positive and negative deviations from canceling each other out and gives greater weight to values that fall far from the center.
The formula for sample variance is:
sยฒ = ฮฃ(X โ Xฬ)ยฒ / (n โ 1)
Here, each data point (X) has the mean (Xฬ) subtracted from it, that difference is squared, all squared differences are summed, and the result is divided by n โ 1 (the number of observations minus one, used for sample data to correct for bias).
What variance tells you
Variance is statistically defined as the average squared deviation from the mean, and it tells you how much individual scores differ from the group average. A high variance means data points are widely scattered; a low variance means they cluster tightly around the mean.
In the context of correlation, variance matters because the strength of a correlation depends on how much variability exists in each variable. If everyone in a study scored almost identically on one variable, there would be very little variance – and very little to correlate. A phenomenon called range restriction occurs when the full variability of a variable is not captured, which can artificially weaken a correlation coefficient. This is why variance is not just background math – it directly influences the magnitude of r.
The standard deviation (s) is simply the square root of variance, and it returns the spread to the original units of measurement. Both variance and standard deviation appear in the final Pearson formula, so understanding variance is non-negotiable.
Covariance: when two variables move together
Variance describes spread in a single variable. Covariance extends this idea to two variables at once – it measures the degree to which X and Y vary together. The key question covariance answers is: as one score changes, does the other score also change in a predictable or consistent way?
The formula for sample covariance is:
Cov(X, Y) = ฮฃ(X โ Xฬ)(Y โ ศฒ) / (n โ 1)
Instead of squaring a single deviation (as in variance), you multiply the deviation of X from its mean by the deviation of Y from its mean, for each pair of observations. You then sum all those products and divide by n โ 1.
Interpreting the sign of covariance
A positive covariance means the variables are positively related – they move in the same direction. A negative covariance means they are inversely related, moving in opposite directions. When both deviation scores are positive (both X and Y are above their respective means), the product is positive. When one is positive and the other negative (one variable is above its mean while the other is below), the product is negative.
Consider a study measuring hours of study (X) and exam scores (Y). If students who study more than average also tend to score above average, then each pair of deviation scores will generally carry the same sign – producing a positive sum and, thus, a positive covariance. The reverse pattern (more study time, lower scores) would produce a negative covariance.
The limitation of covariance
Covariance has one significant practical limitation: its value depends on the units of measurement of the variables. The covariance has units equal to the units of X multiplied by the units of Y, making it difficult to assess how strongly two quantities are related without considering those units. A covariance of 50 between hours of study and exam scores tells you little without knowing the scale of each variable. This makes covariance hard to interpret in isolation, and almost impossible to compare across different pairs of variables.
This limitation is precisely why Pearson’s correlation coefficient was developed.
From covariance to Pearson’s r
Pearson’s correlation coefficient is the covariance of two variables divided by the product of their standard deviations – making it a normalized, unitless version of covariance. Dividing by the standard deviations of both variables scales the covariance to a fixed range of โ1 to +1, regardless of the original units of measurement.
The formula is:
r = Cov(X, Y) / (sX ร sY)
Or equivalently, in its deviation score form:
r = ฮฃ(X โ Xฬ)(Y โ ศฒ) / โ[ฮฃ(X โ Xฬ)ยฒ ร ฮฃ(Y โ ศฒ)ยฒ]
The numerator is the covariance (the shared variability between X and Y). The denominator is the geometric mean of the individual variances (the product of the standard deviations). By dividing the former by the latter, the correlation coefficient becomes a unitless index that can measure the dependence between two variables on a consistent scale.
What the values of r mean
The resulting value of r carries two pieces of information simultaneously: its sign (positive or negative) tells you the direction of the relationship, and its magnitude (closeness to 1 or โ1) tells you the strength.
- r = +1: Perfect positive linear relationship – as X increases, Y increases proportionally.
- r = โ1: Perfect negative linear relationship – as X increases, Y decreases proportionally.
- r = 0: No linear relationship between the two variables.
The interpretation of a correlation coefficient depends heavily on context – a value of 0.4 might be considered weak in physics but meaningful in social science, where many variables are in play and perfect relationships are rarely found.
How the three concepts connect
Mean, variance, and covariance are not three separate ideas you learn and then leave behind – they are sequentially embedded in the Pearson formula. You calculate the mean first. Then you compute deviation scores relative to that mean. Squaring those deviations and averaging them gives you variance (and eventually standard deviation). Multiplying paired deviation scores across two variables and averaging them gives you covariance. Finally, dividing the covariance by the product of both standard deviations produces the correlation coefficient.
Each step narrows and refines the information. Conceptually, Pearson’s correlation is the ratio of the joint covariability of X and Y to the variability of X and Y separately – a measure of how much of the total spread in the data is shared between the two variables. Without the mean, you cannot measure deviation. Without deviation, you cannot measure variance or covariance. Without variance and covariance, there is no Pearson’s r.
This is what makes these three concepts the genuine building blocks of correlation analysis – not abstract theory, but the actual computational steps through which a correlation coefficient is produced and made interpretable.
A note on what correlation does not tell you
Even when mean, variance, and covariance combine to produce a statistically meaningful r value, it is critical to remember that correlation is not causation. A strong Pearson’s r between two variables means they are linearly associated – not that one causes the other. Psychological research frequently encounters correlations between variables that share a common cause, or where the relationship is coincidental. The mathematics of correlation tells you how variables move together; it cannot tell you why.
Additionally, Pearson’s r specifically measures linear relationships. The measure can only reflect a linear correlation of variables and ignores many other types of relationships. Two variables could have a strong curved relationship and still produce an r close to zero if the relationship is not well-approximated by a straight line.
What do you think? When you look at a dataset with two variables, what would a covariance of zero tell you about those variables – and would that necessarily mean they are unrelated? And given that Pearson’s r is built entirely on deviation from the mean, how do you think extreme outliers (values very far from the mean) might affect the correlation coefficient?
References
- https://www.scribbr.com/statistics/pearson-correlation-coefficient/
- https://open.maricopa.edu/psy230mm/chapter/chapter-16-correlations/
- https://www.alchemer.com/resources/blog/variance-covariance-correlation/
- https://tranlevision.medium.com/things-of-probability-mean-variance-standard-deviation-covariance-correlation-and-divergence-ece202bdf4e8
- https://sherrytowers.com/2015/10/26/mean-variance-covariance-and-correlation/
- https://en.wikipedia.org/wiki/Pearson_correlation_coefficient
- https://taylorandfrancis.com/knowledge/Engineering_and_technology/Engineering_support_and_special_topics/Covariance/
- https://www.uv.es/visualstats/vista-frames/help/lecturenotes/lecture11/pearson-ovrh.html
Leave a Reply