Example
In this example, we will use the raw data in the table below to calculate the correlation between the IQ of a person with the number of hours spent in front of TV per week.
IQ, | Hours of TV per week, |
106 | 7 |
86 | 0 |
100 | 27 |
101 | 50 |
99 | 28 |
103 | 29 |
97 | 20 |
113 | 12 |
112 | 6 |
110 | 17 |
First, we must find the value of the term . To do so we use the following steps, reflected in the table below.
- Sort the data by the first column . Create a new column and assign it the ranked values 1,2,3,...n.
- Next, sort the data by the second column . Create a fourth column and similarly assign it the ranked values 1,2,3,...n.
- Create a fifth column to hold the differences between the two rank columns ( and ).
- Create one final column to hold the value of column squared.
IQ, | Hours of TV per week, | rank | rank | ||
86 | 0 | 1 | 1 | 0 | 0 |
97 | 20 | 2 | 6 | −4 | 16 |
99 | 28 | 3 | 8 | −5 | 25 |
100 | 27 | 4 | 7 | −3 | 9 |
101 | 50 | 5 | 10 | −5 | 25 |
103 | 29 | 6 | 9 | −3 | 9 |
106 | 7 | 7 | 3 | 4 | 16 |
110 | 17 | 8 | 5 | 3 | 9 |
112 | 6 | 9 | 2 | 7 | 49 |
113 | 12 | 10 | 4 | 6 | 36 |
With found, we can add them to find . The value of n is 10. So these values can now be substituted back into the equation,
which evaluates to ρ = −0.175757575... with a P-value = 0.6864058 (using the t distribution)
This low value shows that the correlation between IQ and hours spent watching TV is very low. In the case of ties in the original values, this formula should not be used. Instead, the Pearson correlation coefficient should be calculated on the ranks (where ties are given ranks, as described above).
Read more about this topic: Spearman's Rank Correlation Coefficient
Famous quotes containing the word example:
“Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.”
—Marcel Proust (18711922)