Correlation is a statistical measure that expresses the extent to which two variables change together at a constant rate.
Correlation tells us if the two variables have a linear relationship, and the strength of that relationship.
Formula to calculate correlation.
![How to Calculate Correlation.](https://www.learntocalculate.com/wp-content/uploads/2021/01/correlation.png)
σx is the standard deviation of variable x.
σy is the standard deviation for variable y.
Example:
Suppose the covariance of two stocks x and y is 90, calculate their correlation if their standard deviation is 5 and 3 respectively.
![How to Calculate Correlation.](https://www.learntocalculate.com/wp-content/uploads/2021/01/correlation-2.png)
Therefore, their correlation is 6.