% Hazel Data on Magnesium Oxide
% Mg-CaO Data. In many ways magnesium (symbol Mg) is
% very similar to calcium (Ca), and determination of the quantity of one may
% be influenced by the presence of the other. Extremely small amounts of
% calcium, especially in the presence of much magnesium, as in magnesites
% and fused magnesia, cannot be determined satisfactorily by direct precipitation
% as oxalate. Hazel and Eglof (1946) proposed a new method, denoted
% as method B. Its performance was compared to the traditional alcohol
% method (treatment with a mixture of ethyl alcohol, methyl alcohol and
% sulfuric acid), denoted here as method A.
% The column y is obtained by using the method A, while the column z
% is obtained by a Hazel-Eglof method B. Column x is the exact amount of
% CaO present in MgO + CaO, India Magnesite, and Magnesite 104. Part of
% this data ( hazel.dat|mat) was analyzed also by Youden (1951, p.44).
hazel=[...
4.0  3.7 3.9 
8.0   7.8   8.1 
8.5   7.7   8.9 
9.1    8.4   9.2 
9.7    9.4   10.0 
9.9     9.5   9.9 
12.5  12.1    12.4  
16.0   15.6    16.0 
20.0   19.8    19.8  
25.0   24.5    25.0 
26.8   26.1    27.1 
31.0   31.1    31.1 
36.0   35.5   35.8 
40.0   39.4   40.1 
40.0  39.5    40.1 ];
%load 'hazel.dat'
x=hazel(:,1); y=hazel(:,2); z=hazel(:,3);  n=length(x);
mycor = @(x,y) (x(:)-mean(x(:)))'*(y(:)-mean(y(:))) / ...
             sqrt( (x(:)-mean(x(:)))'*(x(:)-mean(x(:)) ) *  ...
                       (y(:)-mean(y(:)))'*(y(:)-mean(y(:))) );
rxy=mycor(x,y); rxz = mycor(x,z); ryz=mycor(y,z);  
%   0.9998    0.9999    0.9996
ryz_x = (ryz - rxy * rxz)/sqrt((1-rxy^2)*(1-rxz^2)) %-0.3861
t= ryz_x * sqrt(n-2-1)/sqrt(1-ryz_x^2)    %-1.5717  

pval =2 * tcdf(-abs(t), n-2-1)    %0.1420