# Pearson Correlation Coefficient

Correlation coefficient is a numerical measure of direction and strength of linear correlation between two variables. Several types of correlation coefficient are defined using various formulas. But Pearson correlation coefficient also known an Pearson product moment correlation coefficient is the most commonly used to describe the linear relationship between two variables, Indeed the term Correlation Coefficient is often loosely used to refer to Pearson Correlation Coefficient.**The formula used to compute Pearson correlation coefficient 'r' is as follows:**

r = $\frac{cov(x, y)}{\sqrt{var(x)}\sqrt{var(y)}}$The covariance between two variables is the average of product of deviations of both the variables from their respective means.

cov (x,y) = $\frac{1}{n}\sum$$(x-\overline{x})(y-\overline{y})$

Covariance
is indeed an easily understandable measure of relationship between the
two variables x and y. But the value of covariance is altered by the
scale and units of measurements used. Pearson's Correlation coefficient eliminates this deficiency. In
Pearson's moment correlation formula, the deviations from the means are
expressed as fractions of standard deviations of each variable. Thus
Pearson correlation coefficient calculated for same data with different
scales or units will give the same value. Hence the measure of
relationship got using Pearson's formula is more dependable.

The above formula leads to an easily workable formula for sample data given in a table.

r = $\frac{n(\sum xy)-(\sum x)(\sum y)}{\sqrt{(n(\sum x^{2})-(\sum x)^{2})(n(\sum y^{2})-(\sum y)^{2})}}$