Diff for "FAQ/OMScorrs" - CBU statistics Wiki
location: Diff for "FAQ/OMScorrs"
Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2008-04-21 10:52:49
Size: 1751
Editor: PeterWatson
Comment:
Revision 12 as of 2008-05-07 09:04:47
Size: 2028
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Comparing correlations in matrices from two subgroups =
Line 2: Line 3:
= Comparing the same correlations in two matrices from a pair of subgroups in SPSS=

The following syntax produces individual group correlation matrices involving variables, x, saves the output to a SPSS data file and then compares two of the groups using Fisher's test (See for example, Howell, (2002)).
The following syntax produces individual group correlation matrices involving variables, x, saves the output to a SPSS data file and then compares two of the groups using Fisher's transformation (See for example, Howell, (2002)).
Line 7: Line 6:
* FISHER'S TEST FOR COMPARING TWO CORRELATIONS FROM TWO INDEPENDENT GROUPS * USING FISHER'S TRANSFORMATION FOR COMPARING TWO CORRELATIONS FROM TWO INDEPENDENT GROUPS
Line 35: Line 34:
* PearsonCorrelation_Var Label * PearsonCorrelation_Var Label which are a bit cumbersome
* so you can rename them as below if you wish and remove
* extraneous information.
Line 41: Line 42:
 /RENAME=(PearsonCorrelation_Male PearsonCorrelation_Female N_Male N_Female = cf cm nf nm).  /RENAME=(PearsonCorrelation_Male PearsonCorrelation_Female N_Male N_Female = cm cf nm nf).
Line 55: Line 56:
COMPUTE Z= (!GP1-!GP2) / SQRT( (1/(!NGP1-3)) + (1/(!NGP2-3)) ).
COMPUTE PZ= CDFNORM(-ABS(Z)).
COMPUTE Z= (0.5*LN(ABS((1+!GP1)/(1-!GP1))) - 0.5*LN(ABS((1+!GP2)/(1-!GP2)))) / SQRT( (1/(!NGP1-3)) + (1/(!NGP2-3)) ).
COMPUTE PZ= 2*CDFNORM(-ABS(Z)).
Line 69: Line 70:

__Reference__

Howell DC (2002) Statistical methods for psychologists. Duxbury Press:Pacific Grove, CA

Comparing correlations in matrices from two subgroups

The following syntax produces individual group correlation matrices involving variables, x, saves the output to a SPSS data file and then compares two of the groups using Fisher's transformation (See for example, Howell, (2002)).

* USING FISHER'S TRANSFORMATION FOR COMPARING TWO CORRELATIONS FROM TWO INDEPENDENT GROUPS

DEFINE !FISH ( GP !TOKENS(1)
             /  X !CMDEND).

SPLIT FILE BY !GP.

OMS 
/SELECT TABLES 
/IF SUBTYPES=['Correlations'] 
/DESTINATION FORMAT=SAV OUTFILE='c:\corrs.sav'
/COLUMNS SEQUENCE=[R3, R1]. 

CORRELATIONS
  /VARIABLES=!X
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE .

OMSEND.
!ENDDEFINE.

*
Specify group variable and variables in correlation matrix.

!FISH GP=SEX X=AGE EDUC PRESTG80.

* Edit the correlation data file and perform Fisher's test. 
* OMS creates names of form using the variable label    
* PearsonCorrelation_Var Label which are a bit cumbersome
* so you can rename them as below if you wish and remove 
* extraneous information.


GET FILE  ='C:\CORRS.SAV'.
SAVE OUTFILE='C:\CORRS2.SAV' 
 /DROP=Command_ to Var2 Sig.2tailed_Female Sig.2tailed_Male
 /RENAME=(PearsonCorrelation_Male PearsonCorrelation_Female N_Male N_Female = cm cf nm nf).
exe.
GET FILE='C:\CORRS2.SAV'.

SELECT IF (CF NE 1 AND CM NE 1).
EXE.

FORMAT CF (F5.2) CM (F5.2).

DEFINE !FISH2 ( GP1 !TOKENS(1)
             /  GP2 !TOKENS(1)
             /  NGP1 !TOKENS(1)
             /  NGP2 !TOKENS(1)).

COMPUTE Z= (0.5*LN(ABS((1+!GP1)/(1-!GP1))) - 0.5*LN(ABS((1+!GP2)/(1-!GP2))))  / SQRT( (1/(!NGP1-3)) + (1/(!NGP2-3)) ).
COMPUTE PZ= 2*CDFNORM(-ABS(Z)).
EXE.

SUMMARIZE
/TABLES=!GP1 !GP2 Z PZ
/FORMAT=LIST NOCASENUM NOTOTAL
/TITLE='CORRELATION COMPARISONS FOR MALES AND FEMALES'
/MISSING=VARIABLE
/CELLS=NONE.
!ENDDEFINE.

!FISH2 GP1=CM GP2=CF NGP1=NM NGP2=NF.

Reference

Howell DC (2002) Statistical methods for psychologists. Duxbury Press:Pacific Grove, CA

None: FAQ/OMScorrs (last edited 2013-03-08 10:17:26 by localhost)