SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
Expand all | Collapse all

My Syntax keeps on giving me the same value that's not related to my study

  • 1.  My Syntax keeps on giving me the same value that's not related to my study

    Posted Sun February 28, 2021 10:08 PM

    I tried out the syntax for testing the differences between two correlation and here's the syntax I found:

    DATASET ACTIVATE DataSet1.

    data list list / r12 r13 r23 n.

    begin data

    .5 .75 .4 100

    end data.

    compute zr13=.5*ln((1+r13)/(1-r13)).

    compute zr23=.5*ln((1+r23)/(1-r23)).

    compute r2bar=.5*(r13**2+r23**2).

    compute f=min((1-r12)/(2*(1-r2bar)),1).

    compute h=(1-f*r2bar)/(1-r2bar).

    compute se=sqrt((2*h*(1-r12))/(n-3)).

    compute z=(zr13-zr23)/se.

    compute p_1=.5*sig.chisq(z**2,1).

    compute p_2=sig.chisq(z**2,1).

    compute l=zr13-zr23-probit(.975)*se.

    compute u=zr13-zr23+probit(.975)*se.

    compute r_diff=(r13-r23).

    compute lower=(exp(2*l)-1)/(exp(2*l)+1).

    compute upper=(exp(2*u)-1)/(exp(2*u)+1).

    execute.

    formats z p_1 p_2 r_diff lower upper (f8.5).

    list r_diff lower upper z p_1 p_2.

    I tried this syntax multiple times and I keep on getting the output of r_diff = 0.035, even though it's not true. Can someone help me troubleshoot this problem? I double-checked the r12, r13, etc and I believe it should have aligned with the code and dataset.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: My Syntax keeps on giving me the same value that's not related to my study

    Posted Mon March 01, 2021 12:03 AM

    Well, the true difference r13 - r23 is .35, and that's what I get when I run your code. The only thing I can think of that might explain what you are seeing is that you have the option to display a leading zero left of the decimal point on fractional values (Edit > Options > General) and are misreading the output, but that seems implausible.

    For this kind of calculation, which is not really across cases, you might find the MATRIX procedure better if you are comfortable with matrix algebra (which is not really being used here).






    #SPSSStatistics
    #Support
    #SupportMigration