Examples of Correlation

Calculate and analyze the correlation coefficient between the number of study hours and the number of sleeping hours of different students.

Number of Study hours
2
4
6
8
10
Number of Sleeping hours
10
9
8
7
6

Solution:

The necessary calculation is given below:

X
Y
\left( {X - \overline X } \right)
\left( {Y - \overline Y } \right)
\left( {X - \overline X } \right)\left( {Y - \overline Y } \right)
{\left( {X - \overline X } \right)^2}
{\left( {Y - \overline Y } \right)^2}
2
10
-4
+2
-8
16
4
4
9
-2
+1
-2
4
1
6
8
0
0
0
0
0
8
7
+2
-1
-2
4
1
10
6
+4
-2
-8
16
1
\begin{gathered} \sum X \\ = 30 \\ \end{gathered}
\begin{gathered} \sum Y \\ = 40 \\ \end{gathered}
\begin{gathered} \sum \left( {X - \overline X } \right) \\ = 0 \\ \end{gathered}
\begin{gathered} \sum \left( {Y - \overline Y } \right) \\ = 0 \\ \end{gathered}
\begin{gathered} \sum \left( {X - \overline X } \right)\left( {Y - \overline Y } \right) \\ = - 20 \\ \end{gathered}
\begin{gathered} \sum {\left( {X - \overline X } \right)^2} \\ = 40 \\ \end{gathered}
\begin{gathered} \sum {\left( {Y - \overline Y } \right)^2} \\ = 10 \\ \end{gathered}

\overline X = \frac{{\sum X}}{n} = \frac{{30}}{5} = 6   and   \overline Y = \frac{{\sum Y}}{n} = \frac{{40}}{5} = 8
{r_{XY}} = \frac{{\sum \left( {X - \overline X } \right)\left( {Y - \overline Y } \right)}}{{\sqrt {\sum {{\left( {X - \overline X } \right)}^2}\sum {{\left( {Y - \overline Y } \right)}^2}} }} = \frac{{ - 20}}{{20}} = - 1

There is perfect negative correlation between the number of study hours and the number of sleeping hours.

Example:

From the following data, compute the coefficient of correlation between X and Y:

X Series
X Series
Number if Items
15
15
Arithmetic Mean
25
18
Sum of Square Deviations
136
138

Summation of products of deviations of X and X series from their arithmetic means = 122.

Solution:

Here n = 15,{\text{ }}\overline X = 25,{\text{ }}\overline Y = 18,{\text{ }}\sum {\left( {X - \overline X } \right)^2} = \sum {\left( {Y - \overline Y } \right)^2} = 138
\sum {\left( {X - \overline X } \right)^2}{\left( {Y - \overline Y } \right)^2} = 122 and hence

r = \frac{{\sum \left( {X - \overline X } \right)\left( {Y - \overline Y } \right)}}{{\sqrt {\sum {{\left( {X - \overline X } \right)}^2}\sum {{\left( {Y - \overline Y } \right)}^2}} }} = \frac{{122}}{{\sqrt {\left( {136} \right)\left( {138} \right)} }} = \frac{{122}}{{137}} = 0.89