Covariance measures whether two variables tend to move together, while correlation measures the strength and direction of that relationship on a standardized scale. Correlation is therefore easier to compare across pairs of variables, whereas covariance retains the variables’ measurement units.
What Covariance Measures
Covariance describes how two variables vary together. If values of one variable tend to be above their mean when values of the other are above its mean, their covariance is positive. If one tends to be above its mean while the other is below its mean, covariance is negative. A covariance near zero indicates little linear co-variation in the data, though it does not rule out a nonlinear relationship.
For paired observations, the sample covariance is calculated by multiplying each observation’s deviation from its own variable’s sample mean, then averaging those products with a sample-size adjustment. In symbols, it is often written as the sum of the paired deviation products divided by n minus one. The population covariance uses population means and divides by the population size instead.
That calculation explains the sign. When paired deviations usually have the same sign, their products are positive; when they usually have opposite signs, products are negative. A concrete example is hours spent studying and an exam score in a particular class: if students with above-average study time also tend to have above-average scores, the sample covariance will likely be positive. That does not establish that studying caused the scores, nor does it describe how strong the relationship is in a unit-free way.
What Correlation Measures
Correlation standardizes covariance by dividing it by the product of the two variables’ standard deviations. For a sample, the Pearson correlation is the sample covariance divided by the sample standard deviation of each variable. This removes the original units and makes the result dimensionless.
Pearson’s correlation ranges from negative one to positive one. A positive value indicates a positive linear association, a negative value indicates a negative linear association, and a value near zero indicates little linear association. Values closer to either endpoint represent a stronger linear pattern. The measure is undefined if either variable has zero standard deviation, because a variable with no variation cannot have a meaningful standardized association.
For example, a researcher might examine whether study time and exam scores rise together. Pearson correlation would summarize the direction and strength of their linear association on the same bounded scale, regardless of whether study time was recorded in minutes or hours. It would not, by itself, show that study time caused a change in scores or capture every possible curved pattern.
Correlation and Covariance Side by Side
| Feature | Covariance | Pearson correlation |
|---|---|---|
| What it describes | Direction of joint variation | Direction and strength of linear association |
| Units | Product of the variables’ units | No units |
| Possible values | No fixed general range | From negative one to positive one |
| Effect of changing measurement units | Its magnitude changes | Unaffected by positive unit conversions |
| Typical use | Calculations involving variance and joint movement | Comparing linear associations across variable pairs |
The two measures are connected, not competing definitions of unrelated ideas. Correlation is covariance expressed relative to the variables’ spread. For a fixed pair of variables, they have the same sign as long as both standard deviations are positive. But their magnitudes answer different questions: covariance is expressed in squared or combined units, while correlation expresses standardized linear association.
Why Units Matter
Suppose a variable is recorded in meters and then converted to centimeters. The numerical values are multiplied by a positive conversion factor. Its covariance with another variable is multiplied by that factor too, so covariance’s magnitude changes. If both variables are converted, covariance is scaled by both conversion factors.
Correlation does not change under such positive rescaling, because the standard deviations are scaled by the same factors as covariance. This is useful when comparing relationships measured in unlike units, such as study time and scores versus attendance and scores. The unit-independence makes correlation easier to interpret across pairs, but it does not make it universally better. Covariance is essential in many statistical formulas, including the covariance matrix used to describe several variables together.
Changing a variable’s direction is different from changing its units by a positive factor. Replacing a score with its negative reverses its direction, so its covariance and correlation with another variable change sign. This is a reminder that the sign depends on how variables are coded.
How to Interpret Both Measures
Start by asking what relationship the calculation is intended to describe. Covariance tells whether paired deviations tend to align or oppose one another. Its sign is often interpretable, but its size is difficult to judge without considering the variables’ units and scales. There is no universal cutoff that makes a covariance “large.”
Correlation offers a standardized description, but it is specifically a measure of linear association when using Pearson’s formula. A correlation close to zero does not necessarily mean that the variables are unrelated. For instance, a perfectly curved relationship can have little or no Pearson correlation even though knowing one variable gives substantial information about the other.
Neither measure establishes causation. A relationship between study time and scores could reflect other influences, such as prior preparation or course difficulty. Likewise, a correlation computed from a sample describes the observed data; inference about a broader population requires additional methods and assumptions.
Common Mistakes Students Make
- Calling covariance unit-free. It carries the product of the variables’ units, which can make its magnitude hard to compare.
- Assuming correlation proves causation. Association alone does not identify what caused what, or whether another factor explains the pattern.
- Treating zero correlation as no relationship. Pearson correlation can miss a strong nonlinear relationship.
- Reading correlation as a percentage. A correlation is not the percentage of one variable explained by another. In a simple linear setting, the squared correlation has a distinct interpretation, but it still does not demonstrate causation.
- Ignoring unusual observations. A small number of extreme points can substantially affect covariance and Pearson correlation.
- Forgetting that correlation is undefined for a constant variable. If a variable never changes, its standard deviation is zero, so the standardization cannot be performed.
A scatterplot is a useful companion to either calculation. It can reveal curvature, clusters, outliers, or a pattern driven by only a few observations—features that one summary number may conceal. For real data, check the plot and the context before describing the result.
Which Measure Should You Use?
Use correlation when the goal is to summarize and compare the direction and strength of linear associations across variables with different units. Use covariance when the units matter, when you need the joint variation in its original scale, or when a statistical procedure specifically requires covariances.
Before choosing, consider these questions:
- Are the variables quantitative and paired, with each observation matched correctly?
- Is the relationship roughly linear, or does a plot suggest a curve?
- Are there unusual observations that might dominate the summary?
- Do you need a standardized comparison or a value in the variables’ units?
- Are you describing a sample, or trying to draw a conclusion about a wider population?
If the relationship is monotonic but not well described by a straight line, a rank-based measure such as Spearman’s correlation may be more appropriate. It assesses whether values tend to move in the same or opposite rank order, rather than measuring linear association in the original values. The choice of measure should follow the research question and the data pattern, not simply whichever statistic is familiar.
How to Remember the Difference
Think of covariance as “co-moving” in the variables’ own units: its sign tells the direction, and its scale depends on measurement. Think of correlation as covariance after standardization: it keeps the direction, puts the result on a common bounded scale, and describes linear strength. The shortcut is useful, provided you remember that neither measure alone identifies causation and Pearson correlation may miss nonlinear structure.
Frequently Asked Questions
Can covariance be larger than one?
Yes. Covariance has no fixed general range, so its value can be greater than one, less than negative one, or between them. Its units and the scales of the variables determine its magnitude.
Can correlation be negative?
Yes. A negative Pearson correlation means that higher values of one variable tend to accompany lower values of the other in a linear pattern. It does not mean the relationship is necessarily strong; strength depends on how far the value is from zero.
Does zero covariance always mean independence?
No. Zero covariance means there is no linear co-variation as captured by that measure. Variables can still have a nonlinear relationship. Under particular assumptions, such as a jointly normal distribution, zero covariance implies independence, but that implication does not hold for all data.
Why do textbooks use covariance if correlation is easier to compare?
Covariance retains scale information and appears naturally in statistical models and calculations, including variance formulas and covariance matrices. Correlation is convenient for interpretation and comparison, while covariance is often useful for computation and modeling.
Can correlation be calculated if one variable is constant?
No. A constant variable has zero standard deviation, making the denominator in the Pearson correlation formula zero. The correlation is undefined rather than zero.