# simulating a repeated measures ANOVA with mixed linear model analysis

#### esmee

##### New Member
Hi all,

I have a data set with two within subject variables, word category (2 levels) and time (3 levels), and I have a between subjects variable, namely group (2 levels). My dependent variable is reaction time (RT).

If I run three separate repeated measures ANOVA for the three different time measurements, I can get exactly the same results if I run a mixed linear model with the covariance structure set to unstructured, see the syntax below.

MIXED RT BY Group word_category
/FIXED = Group word_category Group*word_category
/REPEATED = word_category| SUBJECT(id) COVTYPE(UN).

Id is the participant number.

I get the same results with a GLM:

GLM RT_category1_day1 RT_category2_day1 BY Group
/WSFACTOR=RT 2 Polynomial
/METHOD=SSTYPE(3)
/CRITERIA=ALPHA(.05)
/WSDESIGN=RT
/DESIGN=Group.

However, if I want to include the different time measurements in one analysis as well, I get different results for the GLM and MIXED procedure.

This is the syntax that I used:

GLM RT_category1_day1 RT_category2_day1 RT_category1_day2 RT_category2_day2 RT_category1_day3 RT_category2_day3 BY Group
/WSFACTOR=RT 2 Simple(1) time 3 Simple(1)
/CONTRAST(Group)=Simple(1)
/METHOD=SSTYPE(3)
/WSDESIGN=RT time RT*time

MIXED RT BY Group Time word_category
/FIXED=Group Time word_category Group*Time
Group*word_category Time*word_category
Group*Time*word_category| SSTYPE(3)
/REPEATED=Time*word_category| SUBJECT(id) COVTYPE(UN)
/DESIGN=Group.

I have checked whether the difference in results is because of a difference in the number of measurements, but I do not have any missing values and the number of measurements is the same.

Any idea on how to get similar results with a repeated GLM and mixed when using two within subject factors?

Thanks!