Skip to content
Worked Examples · Example 3
Q.

Compute Karl Pearson's coefficient of correlation for the following data:

xx12345
yy25387
Maharashtra MsbshseTextbookSubjectiveImportance★★★★★est
58% · 7/12 Questions
✓ Free question

Here n=5n = 5. First find the means:

xˉ=1+2+3+4+55=155=3,yˉ=2+5+3+8+75=255=5.\bar x = \frac{1+2+3+4+5}{5} = \frac{15}{5} = 3, \qquad \bar y = \frac{2+5+3+8+7}{5} = \frac{25}{5} = 5.

Take deviations dx=x−3d_x = x - 3 and dy=y−5d_y = y - 5:

xxyydxd_xdyd_ydxdyd_x d_ydx2d_x^2dy2d_y^2
12−2-2−3-3649
25−1-10010
330−2-2004
4813319
5722444
Total00131026

(The check ∑dx=0\sum d_x = 0 and ∑dy=0\sum d_y = 0 confirms the means are correct.) Now

r=∑dxdy∑dx2 ∑dy2=1310 26=13260=1316.1245=0.8062.r = \frac{\sum d_x d_y}{\sqrt{\sum d_x^2}\ \sqrt{\sum d_y^2}} = \frac{13}{\sqrt{10}\,\sqrt{26}} = \frac{13}{\sqrt{260}} = \frac{13}{16.1245} = 0.8062.

Independent check (raw-total formula). ∑x=15, ∑y=25, ∑xy=2+10+9+32+35=88, ∑x2=55, ∑y2=151.\sum x = 15,\ \sum y = 25,\ \sum xy = 2+10+9+32+35 = 88,\ \sum x^2 = 55,\ \sum y^2 = 151.

r=n∑xy−∑x∑yn∑x2−(∑x)2 n∑y2−(∑y)2=5(88)−(15)(25)5(55)−225 5(151)−625=440−37550 130=656500=6580.62=0.8062.r = \frac{n\sum xy - \sum x\sum y}{\sqrt{n\sum x^2 - (\sum x)^2}\,\sqrt{n\sum y^2 - (\sum y)^2}} = \frac{5(88) - (15)(25)}{\sqrt{5(55) - 225}\,\sqrt{5(151) - 625}} = \frac{440 - 375}{\sqrt{50}\,\sqrt{130}} = \frac{65}{\sqrt{6500}} = \frac{65}{80.62} = 0.8062.

Both methods agree.

✓Final answer

r≈+0.806r \approx +0.806 — a high degree of positive correlation.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.