# How do I perform a repeated measures analysis in SPSS involving at least one repeated measures factor with > 99 levels?

It is common in imaging studies to have repeated measures factors which have a high number of levels which are used to construct interaction terms in repeated measures analysis of variance.

SPSS will perform repeated measures anovas for these factors with three-figure levels and use the Greenhouse-Geisser correction which is particularly important for handling repeated measures factors with high numbers of levels. However note that upto *at least* SPSS version 16 anovas on repeated measures factors with a three-figure number of levels can only be produced using syntax. The menu bar interface has an attitude problem and only allows repeated measures factors having upto 99 levels.

For example for an anova for a repeated measures design with three within subject factors (time, priming each with two levels and mags with 102 levels) and one between subjects factor (experiment) is produced using the syntax below.

GLM v1 to v408 BY expt /WSFACTOR=time 2 Polynomial mags 102 Polynomial prime 2 Polynomial /METHOD=SSTYPE(3) /CRITERIA=ALPHA(.05) /WSDESIGN=prime mags time prime*mags prime*time mags*time prime*mags*time /DESIGN=expt.

The 408 data columns correspond to the 2x2x102 combinations of the within subjects factors and these factors are defined on the /WSFACTOR subcommand line in order of how quickly they vary across the columns with the factor which varies *quickest* (prime) on the far right.

Also notice that v1 to v408 is shorthand for entering all 408 columns in order from v1 to v408. The 'v' is the default name for any variables read into SPSS from an EXCEL spreadsheet (ie if you choose to ignore variable names in the spreadsheet).

This syntax may also be obtained by entering the variables using the menu bar and clicking the *paste* button which pastes analogous syntax into a syntax window. You can select more than one variable at a time to define the repeated measures factor by holding the *Alt* and *Ctrl* keys down and left mouse clicking on the variables. This can be quicker than defining one variable at a time especially if you have, as in this example, a lot of variables.

One simple way to produce the above syntax is to use the menu bar to produce the anova but entering a small number of levels (say 3) for mags and clicking the *paste* button. Don't run the programme but go to the syntax window containing the newly pasted syntax. This syntax can then be edited by changing the number of levels of mags to 102 and inserting v1 to v408 for the variables to be analysed and then running the syntax.