FAQ/omscd - CBU statistics Wiki
location: FAQ / omscd

# Using OMS in SPSS to perform Cohen's d

The below example uses the accompanying SPSS data file GSS1991.sav which comes with each version of SPSS the number of sds difference between male and female mean ages. The labels relating to 'sex' in the below will need to be changed (perhaps by formulating the below inside a macro to input them) so that substititutes for the group labels, Male and Female may be given. In the below we assume Pivot Tables variable labels are show as 'Names' and Pivot tables variable values are shown as 'Labels' (as defined under Edit>Output Labels).

```get file='C:\Documents and settings\peterw\desktop\My Documents\macroscourse\output\GSS1991.sav'.

OMS
/SELECT TABLES
/IF SUBTYPES=['Anova']
/DESTINATION FORMAT=SAV OUTFILE='C:\tmp\aov.sav'
/COLUMNS SEQUENCE=[C1,R1].

ONEWAY
age BY sex
/MISSING ANALYSIS.

OMSEND.

OMS
/SELECT TABLES
/IF SUBTYPES=['Report']
/DESTINATION FORMAT=SAV OUTFILE='C:\tmp\aov1.sav'
/COLUMNS SEQUENCE=[C1,R1].

MEANS
TABLES=age  BY sex
/CELLS MEAN COUNT STDDEV  .

OMSEND.

GET FILE = 'C:\tmp\aov.sav'.
SAVE OUTFILE='C:\tmp\aov.sav' /KEEP=MeanSquare_WithinGroups /map.

GET FILE= 'C:\tmp\aov1.sav'.
SAVE OUTFILE='C:\tmp\aov1.sav' /KEEP=Mean_Male Mean_Female.

MATCH FILES FILE = 'C:\tmp\aov1.sav' /FILE='C:\tmp\aov.sav'
/rename (MeanSquare_WithinGroups=Variance).
exe.

compute cd = (Mean_Male-Mean_Female) / sqrt(variance).
exe.```

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