Try each one on paper first, then check a single step. That is worth far more than reading a finished solution.
Example 1 — computing r
For x=1,2,3,4,5 and y=2,4,5,4,6, find the product-moment correlation coefficient.
- 1∑x=15, ∑y=21, ∑xy=71, ∑x2=55, ∑y2=97Lay the sums out in a table before substituting.
- 2Sxy=71−515×21=71−63=8
- 3Sxx=55−5225=10
- 4Syy=97−5441=8.8
- 5r=10×8.88=9.3818
- 6=0.853Between −1 and 1 ✓ A fairly strong positive linear relationship.
Example 3 — Spearman's rank correlation
Two judges rank five entries, giving rank differences −1,1,−1,1,0. Find rs.
- 1rs=1−n(n2−1)6∑d2Only ranks matter, not the raw values.
- 2∑d2=1+1+1+1+0=4Squaring removes the signs.
- 3n(n2−1)=5(25−1)=120
- 4rs=1−12024=1−0.2
- 5=0.8Strong agreement between the judges.