582 15 Correlation
Species X Y X Y X Y X Y
Papilio 24 14 21 15 20 17.5 21.5 16.5
multicaudatus 21.5 16 25.5 16 25.5 17.5 28.5 16.5
23.5 15 22 15.5 22.5 17.5 20.5 19
21 13.5 19.5 19 26 18 23 17
21 18 21 17 20.5 16 22.5 15.5
Papilio 20 11.5 21.5 11 18.5 10 20 11
rutulus 19 11 20.5 11 19.5 11 19 10.5
21.5 11 20 11.5 21.5 10 20.5 12
20 10.5 21.5 12.5 17.5 12 21 12.5
21 11.5 21 12 19 10.5 19 11
18 11.5 21.5 10.5 23 11 22.5 11.5
19 13 22.5 14 21 12.5 19.5 12.5
The observed correlation coefficients are r
1
= −0.1120 (for P. multicauda-
tus) and r
2
= 0.1757 (for P. rutulus). We are interested if the corresponding
population correlation coefficients
ρ
1
and ρ
2
are significantly different.
The Fisher z-transformations of r
1
and r
2
are w
1
= −0.1125 and w
2
=
0.1776. The test statistic is z =
−0.1125−0.1776
p
1/17+1/25
= −0.9228. For this value of z
the p-value against the two-sided alternative is 0.3561, and the null hypothe-
sis of the equality of population correlations is not rejected. Here is a MATLAB
session for the above exercise.
PapilioM=[24, 14; 21, 15; 20, 17.5; 21.5, 16.5; ...
21.5, 16; 25.5, 16; 25.5, 17.5; 28.5, 16.5; ...
23.5, 15; 22, 15.5; 22.5, 17.5; 20.5, 19; ...
21, 13.5; 19.5, 19; 26, 18; 23, 17; ...
21, 18; 21, 17; 20.5, 16; 22.5, 15.5];
PapilioR=[20, 11.5; 21.5, 11; 18.5, 10; 20, 11; ...
19, 11; 20.5, 11; 19.5, 11; 19, 10.5; ...
21.5, 11; 20, 11.5; 21.5, 10; 20.5, 12; ...
20, 10.5; 21.5, 12.5; 17.5, 12; 21, 12.5; ...
21, 11.5; 21, 12; 19, 10.5; 19, 11; ...
18, 11.5; 21.5, 10.5; 23, 11; 22.5, 11.5; ...
19, 13; 22.5, 14; 21, 12.5; 19.5, 12.5];
PapilioMX=PapilioM(:,1); % X
_
m
PapilioMY=PapilioM(:,2); % Y
_
m
PapilioRX=PapilioR(:,1); % X
_
r
PapilioRY=PapilioR(:,2); % Y
_
r
n1=length(PapilioMX);
n2=length(PapilioRX);
r1=corr(PapilioMX, PapilioMY); % -0.1120
r2=corr(PapilioRX, PapilioRY); % 0.1757
%test for rho1 = 0
pval1 = 2
*
tcdf(-abs(r1
*
sqrt(n1-3)/sqrt(1-r1^2)), n1-3);