Next Upcoming Google+ Hangout: Tuesday, August 27 @ 7PM (CST) - To Participate CLICK HERE

Search For Topics/Content

SPSS Topics Discussion > Moderation analysis with a within-subjects variable

I'm trying to determine if my treatment (zinc) moderates the effect of time on open field behavior (this is a common behavioral test used with rats to test anxiety). The trial is 15 minutes long, but is broken into 3 5-minute sections (the behavior habituates with time), so I have 3 dependent variables: center duration at time 1, time 2, and time 3. My IV is group- treatment (zinc) or no treatment. In neuroscience we typically stick to ANOVA, but I have a stats person on my committee who wants me to do a moderation analysis. It took me forever to figure out how to put the data into SPSS in order to run it correctly, but I ended up having 3 lines for each animal, and dummy coding the groups and times- the problem was, my degrees of freedom were way off, because I didn't specify that time was a within-subjects variable. The repeated measures function under GLM allows me to make time a within-subjects factor, as long as I have each of the three DV's in their own column, but then I am not able to put time as a covariate. SPSS also does not allow you to, under the model tab, make a custom model with an interaction that's a within-subjects variable*a between-subjects variable, so I am stuck!

I haven't been able to find anything online about doing moderation analysis in SPSS with a within-subjects variable

March 22, 2012 | Unregistered CommenterErin

Hi Erin!

Great question, it is difficult for me to guide you through the process, based on what you've already done, but I think the following syntax should give you what you are looking for (you'll need to replace a few variable names):

Replace: DVtime1, DVtime2, DVtime3
With: whatever you call your anxiety variables at each time point

Replace: Condition
With: Whatever you call your binary treatment variable

If you replace every occurrence of those variables in the following syntax and run it, it should work (given there isn't anything else about your data that I'm not anticipating):


GLM DVTime1 DVTime2 DVTime3 BY Condition
/WSFACTOR=TIME 3 Polynomial
/MEASURE=Anxiety
/CONTRAST(Condition)=Simple(1)
/METHOD=SSTYPE(3)
/SAVE=PRED RESID
/PLOT=PROFILE(TIME*Condition)
/EMMEANS=TABLES(Condition) COMPARE ADJ(LSD)
/EMMEANS=TABLES(TIME) COMPARE ADJ(LSD)
/EMMEANS=TABLES(Condition*TIME)
/PRINT=ETASQ OPOWER PARAMETER
/CRITERIA=ALPHA(.05)
/WSDESIGN=TIME
/DESIGN=Condition.

March 23, 2012 | Registered CommenterJeremy Taylor

Hi Jeremy,

Thank you for this explanation of moderation in a mixed design.

Is possible to run moderation for repeated designs. I have to stimulation conditions (repeated measures), participants complete a cognitive measure and behavioural measure following each stimulation condition. I want to investigate if these cognitive changes moderate the behavioural response.

Thank you in advance

January 9, 2018 | Unregistered CommenterAdam