I have long had this bit of code that seems likely to have been made by Tor Neilands at U of Texas. The data example in it are mine. You enter the data (the correlations for the independent samples, and sample sizes) in the actual syntax file (no data file running), and it creates the data file it needs but really, it's doing all the math within the syntax file itself. I believe it is sound and have used it, though some scholars have suggested that it's not so simple to compare two different correlations. But I think, often, it is.
* Fisher r to Z testing program.
* Compares correlations from two independent samples.
* See Hays (1988), p. 591.
* Tor Neilands, t.neilands@cc.utexas.edu, Oct. 15, 1999.
** Begin sample program.
* Enter correlations into an SPSS database.
DATA LIST free
/corr1 corr2.
BEGIN DATA.
.67 .35
END DATA.
* Define the sample sizes of each group.
COMPUTE n1 = 39.
COMPUTE n2 = 65.
* Convert r values to Z values.
COMPUTE z1 = .5*LN((1+corr1)/(1-corr1)).
COMPUTE z2 = .5*LN((1+corr2)/(1-corr2)).
* Compute the estimated standard error.
COMPUTE stderr = sqrt((1/(n1-3))+(1/(n2-3))).
* Compute the final Z value. Evaluate this value.
* against a standard normal distribution for.
* statistical significance.
COMPUTE ztest = (z1-z2)/stderr.
COMPUTE p_1_tail = 1 - CDF.NORMAL(abs(ztest),0,1).
COMPUTE p_2_tail = (1 - CDF.NORMAL(abs(ztest),0,1))*2.
* Print the results.
LIST.
** End sample program.
In the example shown above, the SPSS user inputs two sample correlation coefficients,
.67 and .35. He then inputs the sizes of the samples - 39 and 65 cases, respectively.
The program then computes the appropriate Z test for the equality of the two correlations.
It outputs a one-tailed test of the correlations' equality (represented by the p_1_tail variable)
as well as a two-tailed test of the same equality (represented by the p_2_tail variable).
Running that example will produce this output:
corr1 corr2 n1 n2 z1 z2 stderr ztest p_1_tail p_2_tail
.67 .35 39.00 65.00 .81 .37 .21 2.13 .02 .03
Number of cases read: 1 Number of cases listed: 1
Note that you can see that this is an algorithm that others have noted and used as well. If you pull up google gemini and ask this question, you will get a less detailed form of the same method (at least it looks like it is to me!).
Check carefully for yourself, of course.
Scott