The following syntax program works for testing whether two sample
correlations are statistically different or not. However, when one of the correlations is negative the program bombs. I cannot figure out what I need to change in order to get it to run. Help appreciated. martin sherman DEFINE COMPARER (R1=!TOKENS(1) /N1=!TOKENS(1) /R2=!TOKENS(1) /N2=!TOKENS(1)). MATRIX. COMPUTE r1=!r1. COMPUTE n1=!n1. COMPUTE r2=!r2. COMPUTE n2=!n2. PRINT {r1,r2} /FORMAT="f8.2" /TITLE='Correlation coefficients:'. PRINT {n1,n2} /FORMAT="f8.0" /TITLE='Sample sizes:'. COMPUTE zr1=.5*(LN((1+r1)/(1-r1))). COMPUTE varzr1=1/(n1-3). COMPUTE zr2=.5*(LN((1+r2)/(1-r2))). COMPUTE varzr2=1/(n2-3). COMPUTE fisherz=(zr1-zr2)/SQRT(varzr1+varzr2). COMPUTE zsig=2*(1-CDFNORM(ABS(fisherz))). PRINT {fisherz,zsig} /FORMAT="f8.4" /CLABELS="Z" "Sig." /TITLE='Statistic & significance (two-tailed):'. END MATRIX. !ENDDEFINE. COMPARER r1=0.8 n1=20 r2=-0.5 n2=30. |
Hi Martin
I reported that problem in my macro time ago. I also gave the solution them: use it in direct mode: MATRIX. * Input manually the values for r1, n1, r2, n2 *. COMPUTE r1=0.8. COMPUTE n1=20. COMPUTE r2=-0.5. COMPUTE n2=30. PRINT {r1,r2} /FORMAT="f8.2" /TITLE='Correlation coefficients:'. PRINT {n1,n2} /FORMAT="f8.0" /TITLE='Sample sizes:'. COMPUTE zr1=.5*(LN((1+r1)/(1-r1))). COMPUTE varzr1=1/(n1-3). COMPUTE zr2=.5*(LN((1+r2)/(1-r2))). COMPUTE varzr2=1/(n2-3). COMPUTE fisherz=(zr1-zr2)/SQRT(varzr1+varzr2). COMPUTE zsig=2*(1-CDFNORM(ABS(fisherz))). PRINT {fisherz,zsig} /FORMAT="f8.4" /CLABELS="Z" "Sig." /TITLE='Statistic & significance (two-tailed):'. END MATRIX. Someone told me I could modify the macro and pass the arguments between quotation marks, and them eliminate them before using MATRIX, but I didn't test that. MS> The following syntax program works for testing whether two sample MS> correlations are statistically different or not. However, when one of MS> the correlations is negative the program bombs. I cannot figure out what MS> I need to change in order to get it to run. MS> DEFINE COMPARER (R1=!TOKENS(1) /N1=!TOKENS(1) /R2=!TOKENS(1) MS> /N2=!TOKENS(1)). MS> MATRIX. MS> COMPUTE r1=!r1. MS> COMPUTE n1=!n1. MS> COMPUTE r2=!r2. MS> COMPUTE n2=!n2. MS> PRINT {r1,r2} MS> /FORMAT="f8.2" MS> /TITLE='Correlation coefficients:'. MS> PRINT {n1,n2} MS> /FORMAT="f8.0" MS> /TITLE='Sample sizes:'. MS> COMPUTE zr1=.5*(LN((1+r1)/(1-r1))). MS> COMPUTE varzr1=1/(n1-3). MS> COMPUTE zr2=.5*(LN((1+r2)/(1-r2))). MS> COMPUTE varzr2=1/(n2-3). MS> COMPUTE fisherz=(zr1-zr2)/SQRT(varzr1+varzr2). MS> COMPUTE zsig=2*(1-CDFNORM(ABS(fisherz))). MS> PRINT {fisherz,zsig} MS> /FORMAT="f8.4" MS> /CLABELS="Z" "Sig." MS> /TITLE='Statistic & significance (two-tailed):'. MS> END MATRIX. MS> !ENDDEFINE. -- Regards, Dr. Marta García-Granero,PhD mailto:[hidden email] Statistician --- "It is unwise to use a statistical procedure whose use one does not understand. SPSS syntax guide cannot supply this knowledge, and it is certainly no substitute for the basic understanding of statistics and statistical thinking that is essential for the wise choice of methods and the correct interpretation of their results". (Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind) |
Hello Experts:
Thanks for sharing your knowledge till now. I was wondering if you could again share on the following query: I have one variable cluster which has cluster membership of each case. In total there are 3 clusters. I have another variable called gender. I wanted to see the column proportion testing that e.g. male in cluster one are significantly higher than in cluster two and so on. I could use custom table and drag the gender variable in row and cluster variable in column and then click test statistics and column proportions. But, unfortunately, it only shows the difference. I want the p-value of each proportion. Can anyone share their thoughts on how to get the p-value for each proportion/comparisons. Thanks in advance |
Free forum by Nabble | Edit this page |