In: Math
Let x =independent variable =Time spent studying before the exam.
Let y =dependent variable =Marks obtained in the exam.
Let us take a sample of 10 students.
So, the sample size, n =10
Finding correlation coefficient, r:
| x: Time spent studying (in hours) | y: Marks obtained (in %) | x2 | y2 | xy | 
| 2 | 30 | 4 | 900 | 60 | 
| 4 | 29 | 16 | 841 | 116 | 
| 5 | 32 | 25 | 1024 | 160 | 
| 9 | 40 | 81 | 1600 | 360 | 
| 14 | 50 | 196 | 2500 | 700 | 
| 18 | 48 | 324 | 2304 | 864 | 
| 22 | 56 | 484 | 3136 | 1232 | 
| 25 | 63 | 625 | 3969 | 1575 | 
| 30 | 70 | 900 | 4900 | 2100 | 
| 34 | 75 | 1156 | 5625 | 2550 | 
 x
=163 | 
 y
=493 | 
 x2
=3811 | 
 y2
=26799 | 
 xy
=9717 | 

Thus, the correlation coefficient, r =0.991
Calculation of degrees of freedom, df:
Degrees of freedom, df =n - 2 =10 - 2 =8