FAQ/rmform - CBU statistics Wiki

Revision 9 as of 2008-02-19 15:25:36

Clear message
location: FAQ / rmform

How do I format data for input uto a repeated measures analysis of variance in SPSS?

An example data set for activity in different regions of the brain specified by eight combinations of areas corresponding to the x, y and z axes in 3 dimensions. The first four data points for subject 1 are given below. The replicates for each x, y, z combination correspond to different electrodes. These are not presumed to differ so can be pooled.

Morph

Anterior

Lateral

Activity

1

1

1

-0.75

1

1

1

-0.03

1

1

2

0.85

1

1

2

0.61

To present this as repeated measures data in SPSS we need to restructure the data as one row (per subject) with eight columns corresponding to each of the eight regional activity combinations meaned over the electrodes.

This can be done by first specifying a combination factor.

if (morph eq 1 and anterior eq 1 and lateral eq 1) comb=1.
if (morph eq 2 and anterior eq 1 and lateral eq 1) comb=2.
if (morph eq 1 and anterior eq 2 and lateral eq 1) comb=3.
if (morph eq 1 and anterior eq 1 and lateral eq 2) comb=4.
if (morph eq 2 and anterior eq 2 and lateral eq 1) comb=5.
if (morph eq 2 and anterior eq 1 and lateral eq 2) comb=6.
if (morph eq 1 and anterior eq 2 and lateral eq 2) comb=7.
if (morph eq 2 and anterior eq 2 and lateral eq 2) comb=8.
exe.

We can then use split file with a sort cases commands and the output management system to produce a table of combination means for each subject and send these to a SPSS data file.

SORT CASES BY subj .
SPLIT FILE
  LAYERED BY subj .

OMS
/SELECT TABLES
 /IF SUBTYPES=['Report']
 /DESTINATION FORMAT=SAV
  OUTFILE="C:\comb.SAV"
 /COLUMNS SEQUENCE=[C1 R2].

MEANS
  TABLES=mmna  BY comb
  /CELLS MEAN COUNT STDDEV.

OMSEND.

For the first two subjects this produces

Mean111

Mean211

Mean121

Mean112

Mean221

Mean212

Mean122

Mean222

Sub 1

-0.22

0.93

-0.42

-0.19

0.24

-0.25

-0.16

-0.36

Sub 2

-1.22

-0.93

-0.52

-0.69

-0.04

0.05

-0.06

-0.76

The data can now be used in a [:FAQ/glmrm:repeated measures analysis.]