Covariance measures how two variables change together across paired data. It tells whether values of X above their mean tend to occur with values of Y above or below its mean. A positive covariance suggests the variables move in the same direction, while a negative covariance suggests they move in opposite directions.
This matters because covariance is the foundation for understanding correlation, regression, and patterns in scatter plots.
Understanding Statistics: Covariance
The calculation works by measuring each value’s distance from its own average. For every paired observation, find how far the first measurement sits above or below its average. Do the same for the second measurement.
Then multiply those two distances. Two distances with the same sign give a positive product. Distances with different signs give a negative product.
Adding all these products shows which type of pairing is more common and how strong those paired departures are. This focus on distance from the average is important. Raw values alone can hide the pattern because variables may use very different starting points.
A covariance near zero needs careful interpretation. It can mean there is little straight line pattern in the data. It does not prove that the variables have no connection.
Consider daily temperature and electricity use for heating and air conditioning. Electricity use can be high on very cold days and on very hot days, yet lower on mild days. The relationship is real, but its curved shape can produce a covariance close to zero because opposite patterns cancel.
A scatter plot is useful beside the calculation. It can reveal curves, separate groups, gaps, or clusters that one summary number cannot show.
Large unusual observations can change covariance a great deal. A single student with an extremely high number of study hours, or a single town with an unusually large population, may contribute a very large product of distances. That point can pull the result toward one direction even when most observations show a weaker pattern.
Students should inspect the original pairs and the scatter plot before trusting a result. They should check whether an outlier is a recording mistake, a real but rare case, or a sign that the data contain different groups. Removing real data simply because it is inconvenient can create a misleading conclusion.
Paired data must be matched correctly. If each person’s height is paired with another person’s shoe size by accident, the calculation no longer describes a real relationship. This matters in spreadsheets, surveys, experiments, and scientific records.
Covariance is often used in finance to compare how investments vary over time, in weather studies to examine linked measurements, and in regression to help estimate a line of best fit. It does not show that one variable causes the other. Ice cream sales and sunburn cases may rise together because sunny weather affects both.
When learning this topic, keep track of the units, the pairing, the graph shape, and possible outside factors. These checks give the number its proper meaning.
Key Facts
- Sample covariance: s_xy = Σ[(x_i - x_bar)(y_i - y_bar)] / (n - 1)
- Population covariance: cov(X,Y) = Σ[(x_i - μ_x)(y_i - μ_y)] / N
- Positive covariance means above-average X values tend to pair with above-average Y values, and below-average X values tend to pair with below-average Y values.
- Negative covariance means above-average X values tend to pair with below-average Y values, or the reverse.
- Correlation rescales covariance: r = s_xy / (s_x s_y)
- Covariance has units equal to the units of X times the units of Y, so its size is hard to compare across different data sets.
Vocabulary
- Covariance
- Covariance is a measure of how two variables vary together relative to their means.
- Deviation
- A deviation is the difference between a data value and its mean, such as x_i - x_bar.
- Scatter plot
- A scatter plot is a graph of paired data points that shows the relationship between two quantitative variables.
- Correlation
- Correlation is a standardized version of covariance that ranges from -1 to 1.
- Mean
- The mean is the arithmetic average of a set of values.
Common Mistakes to Avoid
- Treating covariance size as easy to interpret is wrong because covariance depends on the units and scales of both variables.
- Forgetting to subtract the means is wrong because covariance is based on paired deviations, not on the raw x and y values themselves.
- Using n instead of n - 1 for sample covariance is wrong when estimating covariance from a sample because n - 1 gives the standard unbiased estimator.
- Assuming positive covariance proves causation is wrong because covariance shows association, not that one variable causes the other.
Practice Questions
- 1 For the paired data (1,2), (2,4), (3,5), compute the sample covariance s_xy.
- 2 A data set has sample covariance s_xy = 18, standard deviation s_x = 6, and standard deviation s_y = 5. Compute the correlation r.
- 3 Two scatter plots both show positive covariance, but one uses height in centimeters and weight in kilograms while the other uses height in meters and weight in grams. Explain why comparing the covariance numbers directly can be misleading.