SPSS Statistics

 View Only

 LMM: How to set up the data structure with 2 "Repeated" Variables?

Mithat Erdogan's profile image
Mithat Erdogan posted Sat January 11, 2025 05:41 PM

Hello,

I have a dataset with the following structure (excluding DV and other factors):

  • ID represents the individual participants
  • trial represents the trial numbers for each participant 
  • seconds represents the time measurement for each second within a trial (8 seconds per trial)

For each participant, there are 12 trials, and within each trial, there are 8 seconds of data, resulting in a total of 12x8 data points per participant. I have the data in long format as is required for LMM. 

I know to set the "Subjects"-Box as the ID variable, but i dont know how to ensure that SPSS recognizes the trial numbers as belonging together while correctly linking the seconds to the respective trial. I understand that i could just put the "trials" in the "Repeated"-Box , if i did not have "seconds".

But how exactly can i set this up when i have 2 variables where one is nested in the other?

Can i just put both "trial" and "seconds" in the "Repeated" box and SPSS sees this, based on how the data is structured (long-format)?

David Dwyer's profile image
David Dwyer

Hi @Mithat Erdogan

From your description I am assuming you have data organized for a Between Subjects design -- Multiple records per ID and each record represents an observation at each of the TRIAL and SECONDS combinations. 

Likely what you need is data organized for a Within Subjects design -- A single record per ID where each field/variable represents an observation at each TRIAL and SECONDS combination.

Transforming a BETWEEN organization of your data into a WITHIN organization can be accomplished with the "Data -> Restructure . . ." wizard and the "Restructure selected cases into variables" radio button:

The command syntax underneath this wizard is the CASESTOVARS command.  Here is a worked example using fake data and the GLM procedure.
I hope this helps!