Eneahoric correlation coefficient. Applicative program.
Costescu, Mihai Radu
X Y Superior Medium Inferior
Superior [n.sub.1] a [n.sub.2] A = [n.sub.1] +
a + [n.sub.2]
Medium b c d
Inferior [n.sub.4] e [n.sub.3] B = [n.sub.4] +
e + [n.sub.3]
D = [n.sub.1] + C = b +
b + [n.sub.4] [n.sub.2] +
d + n
procedure
eneahoric(n,n1,n2,n3,n4,a,b,d,e:in
teger;alfa:real;var r:real);
{The procedure calculates the
eneahoric correlation coefficient
for a given number of subjects;
Once this coefficient is calculated,
its meaning will be checked
for a chosen meaning threshold :
0,10; 0,05; 0,02; 0,01 sau 0,001;
Parameters meaning is:
n = the total number of subjects
(12,22,32,42,52,62,72,82,92 or 102)
variabila X: mare mediu mic
mare n1 a n2
variabila Y: mediu b d
mic n4 e n3
alfa = pragul de semnificatie ales
r = coeficientul de corelatie}
var aa,bb,cc,dd:integer;
v:array[1..100] of real;
begin
if alfa=0.10
then
begin
v[10]:=0.4973; v[20]:=0.3598; v[30]:=0.2960;
v[40]:=0.2573; v[50]:=0.2306; v[60]:=0.2108;
v[70]:=0.1954; v[80]:=0.1829; v[90]:=0.1726;
v[100]:=0.1638;
end;
if alfa=0.05
then
begin
v[10]:=0.5760; v[20]:=0.4227; v[30]:=0.3494;
v[40]:=0.3044; v[50]:=0.2732; v[60]:=0.2500;
v[70]:=0.2319; v[80]:=0.2172; v[90]:=0.2050;
v[100]:=0.1946;
end;
if alfa=0.02
then
begin
v[10]:=0.6581; v[20]:=0.4921; v[30]:=0.4093;
v[40]:=0.3578; v[50]:=0.3218; v[60]:=0.2948;
v[70]:=0.2737; v[80]:=0.2565; v[90]:=0.2422;
v[100]:=0.2301;
end;
if alfa=0.01
then
begin
v[10]:=0.7079; v[20]:=0.5368; v[30]:=0.4487;
v[40]:=0.3932; v[50]:=0.3541; v[60]:=0.3248;
v[70]:=0.3017; v[80]:=0.2830; v[90]:=0.2673;
v[100]:=0.2540;
end;
if alfa=0.001
then
begin
v[10]:=0.8233; v[20]:=0.6524; v[30]:=0.5541;
v[40]:=0.4896; v[50]:=0.4433; v[60]:=0.4078;
v[70]:=0.3799; v[80]:=0.3568; v[90]:=0.3375;
v[100]:=0.3211;
end;
aa:=n1+a+n2;
bb:=n4+e+n3;
cc:=n2+d+n3;
dd:=n1+d+n4;
r:=(n 1+n3-n2-n4-(aa-bb)*(cc-dd)/n);
r:=r/sq rt ( (a a+bb-sq r(aa-bb)/n)*(cc+ddsq
r(cc-dd)/n));
writeln('r = ',r:5:4);
if r > v[n-2] then writeln('Coeficientul
de corelatie este semnificativ')
else writeln('Coeficientul
de corelatie nu este semnificativ'
end;