1

SPSS syntax for Williams test of two correlations on the same people with one variable in common is taken from here.

 ================================================ . 
* File name:   Williams1959.sps . 
* Written by:  Bruce Weaver, bwe...@lakeheadu.ca 
* Date:        15-May-2012. 
* ================================================ . 

* SPSS program to compute Williams' (1959) test for 
* comparing two correlations with one variable in common. 
* The example used here is from Dave Howell's book 
* "Statistical Methods for Psychology" (6th Ed., p. 262). 
* It assumes the user wants the difference r12 - r13. 
* This example reads in only one row of data, but one could 
* read in several rows of data, with one test per row. 

data list list / r12 r13 r23 (3f5.3) n (f5.0). 
begin data 
0.80 0.72 0.89 26 
end data. 

compute #R = (1 - r12**2 - r13**2 - r23**2) + 
              2*r12*r13*r23. 
compute diff = r12 - r13. 
compute t = diff * 
            SQRT( ((n-1)*(1+r23)) / 
                   (2*((n-1)/(n-3))*#R + 
                  ((r12+r13)**2/4)* 
                   (1-r23)**3) ). 
compute df = n-3. 
compute p = cdf.t(abs(t)*-1,df)*2. 
formats t p diff (f5.3) / df (f5.0). 
list r12 r13 diff t df p. 

OUTPUT: 

   r12    r13  diff     t    df     p 
  .800   .720  .080 1.361    23  .187 

Number of cases read:  1    Number of cases listed:  1