*******************************************;
* CORRDIFF.SAS
* Enter one line for each test of 
* independent correlations as in the
* sample cases below.
*******************************************;
data corrdiff; 
input n1 n2 r1 r2;
datalines;
75 70 0.98 0.82
75 70 0.81 0.92
75 70 0.90 0.87
75 70 0.95 0.92
75 70 0.94 0.95
75 70 0.88 0.88
75 70 0.92 0.95
75 70 0.97 0.88
75 70 0.97 0.90
;
run;
*******************************************;
DATA CORRDIFF;  set corrdiff;
*******************************************;
N13=1/(n1-3);                        
N23=1/(n2-3);                        
SD=SQRT(N13+N23);                    
Z1A=LOG(1+r1);                       
Z1B=LOG(1-r1);                       
Z2A=LOG(1+r2);                       
Z2B=LOG(1-r2);                       
Z1=(Z1A-Z1B)/2;                      
Z2=1/2*(LOG(1+r2)-(LOG(1-r2)));      
Z=(Z1-Z2)/SD;          
run;
*******************************************;
TITLE "CORRDIFF results"; run;
proc print data=corrdiff;
var n1 n2 r1 r2 z;
run;
*******************************************;