Diff for "FAQ/rmform" - CBU statistics Wiki
location: Diff for "FAQ/rmform"
Differences between revisions 14 and 15
Revision 14 as of 2008-04-28 16:04:39
Size: 4211
Editor: PeterWatson
Comment:
Revision 15 as of 2008-05-06 15:23:54
Size: 4356
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 47: Line 47:
GET FILE ='C:\comb.SAV'.
SAVE OUTFILE='C:\comb2.SAV'
 /DROP=Command_ to Var2 N_1.00 to Std.Deviation_Total.
exe.
GET FILE='C:\comb2.SAV'.

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. Each subject has replicates of the x, y, z combinations each of which are tried with differing numbers of electrodes. The activities across electrodes 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.

GET FILE ='C:\comb.SAV'. SAVE OUTFILE='C:\comb2.SAV'

  • /DROP=Command_ to Var2 N_1.00 to Std.Deviation_Total.

exe. GET FILE='C:\comb2.SAV'.

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.]

  • [:FAQ/btow: Stacking a within subjects factor as a between subjects factor]
  • [:FAQ/wtob: Unstacking a between subjects factor to form within subjects factors].

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