In statistics, venturing beyond single variables unlocks a new world of exploration: the relationships between them. Let’s get into two key measures – covariance and the linear correlation coefficient – that illuminate these connections. We’ll use a relatable example: the fascinating interplay between house size and price.
The Real Estate Connection: Size Matters (Usually)
Consider house hunting. A crucial factor influencing price is undoubtedly the size of the property. Generally, larger houses command a higher premium as people crave spacious living.
To illustrate this concept, let’s analyze a dataset containing house size and corresponding listed:
House Size vs. Price
| House Number | Size (sq ft) | Price (USD) |
| 1 | 1,500 | 250,000 |
| 2 | 2,000 | 300,000 |
| 3 | 1,200 | 220,000 |
| 4 | 2,500 | 350,000 |
| 5 | 1,800 | 280,000 |
By plotting these data points in a scatter plot (with size on the X-axis and price on the Y-axis), a pattern emerges. We observe a clear correlation between the two variables, signifying a connectedness.
Explaining the Connection: Enter Covariance
This correlation is quantified by a statistic called covariance. Unlike variance, which deals with the spread of a single variable, covariance captures how two variables move together.
The result can be positive, negative, or zero, offering valuable insights:
- Positive Covariance: If the variables move in the same direction (e.g., larger houses with higher prices), the covariance will be positive.
- Negative Covariance: Conversely, if they move in opposite directions (e.g., more expensive cars having lower mileage), the covariance will be negative.
- Zero Covariance: When the movements are independent (e.g., no relation between shoe size and vocabulary), the covariance will be zero.
Calculating Covariance: Under the Hood
To go deeper, let’s explore the formula for sample covariance (denoted by Sxy):
Sxy = Σ [(Xi – X̅) * (Yi – Ȳ)] / (n – 1)
Where:
- Σ (sigma) represents summation across all data points (n).
- Xi is the size of house i.
- X̅ (X-bar) is the average house size.
- Yi is the price of house i.
- Ȳ (Y-bar) is the average house price.
Applying the Formula to Our Example
We’ll calculate the covariance for the data in Table 1. This involves finding the mean size, mean price, and then plugging the values into the formula. The result will provide a numerical indication of the directional relationship between house size and price.
Beyond Covariance: The Need for Standardization
Covariance, however, has a limitation. The resulting value depends on the units of measurement (square feet for size and dollars for price). A covariance of 5 might suggest a weak connection in one dataset, while in another (with prices in millions), it could indicate a strong correlation.
This is where the linear correlation coefficient, explored in the next part of this series, comes into play. It offers a standardized measure, ranging from -1 to +1, that transcends the units and provides a clearer picture of the strength and direction of the linear relationship between two variables.
For further information:


Leave a comment