function M=exam3_8
%example 3.8
%8/30/2007 by Changxing Ma

nnn=[38     2     2     5    11     1    10    31];

n00=nnn(1)+nnn(8);
n01=nnn(2)+nnn(7);
n10=nnn(4)+nnn(5);
n11=nnn(3)+nnn(6);
nn=[n00 n01 n10 n11];
n=sum(nn);

rAB=(n10 + n11)/n;
rBC=(n01 + n11)/n;
rAC=(n01 + n10)/n;
                                                                                     
R1=[rAB  rBC rAC rAB+rBC-2*rAB*rBC]';
R2=[rAB  rBC rAC (rAB+rBC)/(1+4*rAB*rBC)]';

M=[R1 -log(1-2*R1)/2*100 R2 log((1+2*R2)./(1-2*R2))/4*100];
