Measures of Relationship
Definition: The statistical measures which show a relationship between two or more variables are called Measures of Relationship. Correlation and Regression are commonly used measures of relationship. In this blog, we will understand the Covariance measure and its calculations steps. Part 2 of this blog will explain the calculation of Correlation.
(Related read: Linear Regression Blog Series)
Covariance is the measure of the joint variability of two random variables (X, Y). For Example – Income and Expense of Households. The households having higher Income (say X) will have relatively higher Expenses (say Y) and vice-versa. This kind of relationship between two variables is called joint variability and is measured through Covariance and Correlation.
Covariance is represented as Cov(X, Y). (Wikipedia link). The covariance can Positive, Negative, or Zero.
|Positive Covariance: If the variable(X) takes a higher value, the value of the corresponding variable(Y) is also higher and vice-versa.
E.x. Income and Expense of Household. As X takes a higher value, the corresponding values of Y is on the higher side
|Negative Covariance: If the variable(X) takes a higher value, the value of the corresponding variable(Y) is low and vice-versa.
Example: Price and Demand. As the Price of a commodity increases, its Demand decreases.
|Zero Covariance or No Covariance: There is no linear relationship between variable(X) and variable(Y).
Note: The Zero Covariance means the covariance will be zero or near zero
To understand the concept of covariance, it is important to do some hands-on activity. A sample survey data of 15 households is given below. The fields are Monthly Income, Monthly Expense, and Annual Income details of the households.
A scatter plot is best used to visually see the linear relationship between X and Y.
|From the above two scatter plots we can see that Monthly Income has positive covariance with both the variables, Annual Income, and Monthly Expense.
However, the linearity between Monthly Income and Annual Income appears to be much strong as compared to the relationship between Monthly Income and Monthly Expense.
The strength of the linear relationship between two continuous variables is measured by a statistical measure called Correlation
Let us denote Monthly Household Income as X and Monthly Household Expense as Y. Then the covariance of Monthly Income and Expense is:
Intermediate covariance calculation steps
|X – mean(x)||Y – mean(y)||(X – mean(x))
* (Y – mean(y))
Sum(X – mean(x)) * (Y – mean(y))
Final covariance calculation step
Interpretation of Covariance
- The covariance between the Monthly Income and the Monthly Expense is 15949523.81.
- It is a positive number, hence we conclude there is a positive relationship between Monthly Household Income and the Expense. i.e., when the Monthly Household Income takes a higher value, the corresponding Expense value is also likely to be higher and vice-versa.
Disadvantage of Covariance
- Covariance only measures the direction of the relationship, but it does not measure the strength of the relationship. In order to measure the strength, we need to calculate the normalized version of covariance, i.e., Correlation
Application of Variance-Covariance: Beta of Stock
The variance-covariance measures do not have any business meaning by themselves. However, these measures are used in calculations of other test statistics like ANOVA, R-Squared, hypothesis testing, statistical inference, and more. One practical application of Variance-Covariance is in calculating the Beta of Stock. Beta is a concept that measures the expected move in a stock relative to movements in the overall market. (Investopedia article on Beta of Stock)
- Covariance only shows the direction of the linear relationship between two Variables (I.e., Positive, Negative, or No Covariance). It cannot measure the strength of the relationship between the two variables.
- To measure both the strength and direction of the linear relationship between two variables, we use a statistical measure called correlation.
- The correlation only measures the association. The Association is not Causation.
- The Formula to Calculate the Correlation Coefficient (r) between Variable is
- ‘r’ takes any value between -1 and 1
Correlation Range Interpretation r = 1 Perfectly Positive Linear Relationship between two variables r = -1 Perfectly Negative Linear Relationship between two variables r = 0 No Relationship between two variables
Positive, Negative, Zero Correlations
The two variables(X, Y) can have Positively Correlation, Negatively Correlation, or Zero correlation.
Let’s calculate the correlation coefficient between two variables (monthly Income, Monthly Expense) for 15 sample household Survey data given in the below table.
- Let X be the Monthly Income and Y be Monthly Expense, Then the Correlation coefficient r is,
- In the previous blog, We have already calculated the Covariance between the Variable Monthly Income and Monthly Expense. Refer to the Previous blog for Covariance calculations.
- Mean Calculations
- Intermediate Correlation Calculations
Mthly_HH_Income (X) Mthly_HH_Expense (Y) X – Mean(X) (X – Mean(X))^2 Y – Mean(Y) (Y – Mean(Y))^2 5000.00 8000.00 -11193.33 125290711.11 -2933.33 8604444.44 6000.00 7000.00 -10193.33 103904044.44 -3933.33 15471111.11 10000.00 4500.00 -6193.33 38357377.78 -6433.33 41387777.78 10000.00 2000.00 -6193.33 38357377.78 -8933.33 79804444.44 12500.00 12000.00 -3693.33 13640711.11 1066.67 1137777.78 14000.00 8000.00 -2193.33 4810711.11 -2933.33 8604444.44 15000.00 16000.00 -1193.33 1424044.44 5066.67 25671111.11 18000.00 20000.00 1806.67 3264044.44 9066.67 82204444.44 19000.00 9000.00 2806.67 7877377.78 -1933.33 3737777.78 20000.00 9000.00 3806.67 14490711.11 -1933.33 3737777.78 20000.00 18000.00 3806.67 14490711.11 7066.67 49937777.78 22000.00 25000.00 5806.67 33717377.78 14066.67 197871111.11 23400.00 5000.00 7206.67 51936044.44 -5933.33 35204444.44 24000.00 10500.00 7806.67 60944044.44 -433.33 187777.78 24000.00 10000.00 7806.67 60944044.44 -933.33 871111.11 sum((X – mean(X))^2) 573449333.33 sum((Y – mean(Y))^2) 554433333.33
- Standard deviation Calculations
- Final Correlation Calculation
The correlation between monthly Income and monthly Expense is 0.396. Therefore, there is a Low Positive correlation between Monthly Household Income (X), and the Monthly Household Expense (Y).
- Calculate the Correlation coefficient between Monthly Household Income and Annual Household Income for data that we used as an example and complete the following Table.
- Total Number of Observations (n)
- Mean of Monthly Household Income
- Mean of Annual Household Income
- The covariance of Monthly Household Income and Annual Household Income
- The Standard Deviation of Monthly Household Income
- The Standard Deviation of Annual Household Income
- The Correlation Coefficient r
- Is the linear relationship between the two variable is positive or negative and Explain it?
- We will discuss the Answers to our Practise Exercises. Later, We will discuss the Graphical Methods in Descriptive Statistics.