Introduction

The correlation is one of the most common and most useful statistics. A correlation is a single number that describes the degree of relationship between two variables. Let’s work through an example to show how this statistics is computed.

Correlation Example

Let’s assume that we want to look at the relationship between two variables, height and self esteem. Perhaps we have a hypothesis that how tall you affect your self esteem. Let’s say we collect some data from 20 individuals. Height is measured in inches. Self esteem is measured based on the average of 10 1-to-5 rating items, where higher scores mean higher self esteem. Below is the data:

PersonHeightSelf Esteem
1684.1
2714.6
3623.8
4754.4
5583.2
6603.1
7673.8
8684.1
9714.3
10693.7
11683.5
12673.2
13633.7
14623.3
15603.4
16634.0
17654.1
18673.8
19633.4
20613.6

Now, let’s take a quick look at the histogram for each variable:

correlation

And, here are the descriptive statistics:

VariableMeanStDevVarianceSumMinimumMaximumRange
Height65.44.4057419.41051308587517
Self Esteem3.7550.4260900.18155375.13.14.61.5
Finally, we’ll look at the simple bi-variate plot:

correlation

Calculating the Correlation

Now we are ready to compute the correlation value. The formula for the correlation is:

correlation

Where N is the number of the pair, ∑xy is the sum of the products of the pair, ∑x is the sum of x, ∑y is the sum of y, ∑x2 is the sum of the squared x, ∑y2 is the sum of the squared y.

For above case, N=20, ∑xy=4937.6, ∑x=1308, ∑y=75.1, ∑x2 =85912, ∑y2=285.45. Now, when we plug these values into the formula given above, we get the following:

correlation

The correlation for this case is 0.73, which is a fairly strong positive relationship. So, we guess there is a relationship between height and self esteem, at least in this made up data!

References & Resources

  • N/A