# Mixed model in SPSS with random effect and repeated measures

I am working on analyzing a dataset that involves repeated measures data. The data was previously analyzed by a colleague using custom code written in C++, but I have expanded the dataset and am trying to analyze it in SPSS in a similar way. The dataset has a subjects variable that I want to specify as a random-effects variable and two within-subjects variables with two levels each. From what I've read so far, the Mixed Model command in SPSS seems to be the most appropriate way to analyze this data. I'm unfamiliar with analyzing the data in this way but I've tried to read up on it and I will post the syntax I used to supplement my questions.

The experimental design is like this: I have one variable, subjects, that I want to include as a random factor. The subjects saw images followed by letter strings on a computer screen and had to decide whether the string was a word or non-word. I have two within-subjects factors: "wordness" (whether the string was a word or non-word) and "relatedness" (whether the string was related to the image or unrelated). Subjects will perform multiple trials, so they will have responses for all four combinations of wordness and relatedness: related word, related non-word, unrelated word, and unrelated non-word. Together, I think, this forms a nested repeated measures design. The dependent variable is reaction time.

My biggest issue is with how to specify "subjects" as a random effects variable. I've tried adding it as a subjects variable through the GUI (yielding the following syntax):

MIXED Rt2Adj BY Relatedness Wordness Subjects
/CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
/FIXED=Relatedness Wordness Relatedness*Wordness | SSTYPE(3)
/METHOD=REML
/PRINT=SOLUTION
/REPEATED=Relatedness*Wordness | SUBJECT(Subjects) COVTYPE(UN).


This runs without errors, but I notice that there are no random effects variables listed in the Model Dimension output table. If I add subjects as a random effects variable in addition to specifying it as the subjects variable with the following syntax:

MIXED Rt2Adj BY Relatedness Wordness Subjects
/CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
/FIXED=Relatedness Wordness Relatedness*Wordness | SSTYPE(3)
/METHOD=REML
/PRINT=DESCRIPTIVES
/RANDOM=Subjects | COVTYPE(VC)
/REPEATED=Relatedness*Wordness | SUBJECT(Subjects) COVTYPE(UN).


I get an error when I try to run the analysis:

"Iteration was terminated but convergence has not been achieved. The MIXED procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain.")

I'm assuming that this is because the model is over-specified, because "subjects" was assigned as both the subjects variable and as a random effects variable. So my question is this: in the GUI, SPSS says "Specify subjects for models with correlated random effects". If I specify subjects under this heading, does the model interpret this variable as if it were a random effect variable (even though it doesn't list "subjects" as a random effect under the Model Dimension table the way it does if I manually enter "subjects" as a random effect variable)? Is there any other way to ensure that subjects is entered into the model as a random effect? I am having trouble finding a clear answer to this question because many of the other questions I've seen posted have used a different variable (not subjects) as a random effect.

A second question is the following: I used the first syntax pasted above to analyze a very small dataset (4 subjects). Although the analysis ran without errors on a larger dataset, when I ran the analysis on this small dataset I got the following error:

"Iteration was terminated but convergence has not been achieved. The MIXED procedure continues despite this warning. Subsequent results produced are based on the last iteration. Validity of the model fit is uncertain."

Can a very small sample size cause this error?

• Once you combine your multiple accounts, Kelly, you will be able to edit and comment on this post. (Because you used a different account, you were forced to post your follow-on questions as an answer and I could not preserve all of it when changing it into a comment to the answer.) – whuber Aug 25 '14 at 14:51
• If you use a standard repeated measurements ANOVA, then "subjects" will automatically be treated as a random effect. Also, that analysis will display methods that either don't assume or adjust for violations of sphericity. Also, have you considered treating "words" as a random effect so that your results can be generalized to words not used in your experiment. – David Lane May 4 '17 at 0:30