## Repeated measures ANOVA and GAMLj

Discuss statistics related things

## Repeated measures ANOVA and GAMLj

I analyzed my data using a 2X2 repeated measures ANOVA and then did the same thing using a General Linear Model on the (excellent) GAMLj module. Surprisingly, results were very different: on the repeated measures ANOVA I got 1 sig. main effect and a sig interaction; on the GLM, I got 2 sig. main effects and a sig. interaction.

I am curious about what is going on here? Has anyone experienced a similar situation?

Thank you.
Tomás
TPalma

Posts: 9
Joined: Fri Jul 14, 2017 9:04 am

## Re: Repeated measures ANOVA and GAMLj

Hi, would you share the analyses so we can check them out?

mcfanda@gmail.com

Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm

## Re: Repeated measures ANOVA and GAMLj

Hi Marcello,

Sure, see attachments.

Thanks!
Tomás
Attachments
rm_anova.omv
glm.omv
TPalma

Posts: 9
Joined: Fri Jul 14, 2017 9:04 am

## Re: Repeated measures ANOVA and GAMLj

Hi
in the GAMLj module you used GLM, which implements the general linear model. One assumption of the GLM is that the dependent variable scores are independent, meaning that the design is between-subjects. To analyze a repeated measure design with GAMLj (and in general with linear models) you need to use the Mixed model, because it allows capturing the dependence in the data.

If you run a mixed model on your data, with race and typicality as random effects, you get very similar results to the RM anova,

race.png (18.97 KiB) Viewed 1938 times

mcfanda@gmail.com

Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm

## Re: Repeated measures ANOVA and GAMLj

Hi,

Thanks for the clarification!

One question regarding the mixed model: why are race and typicality random and not fixed effect? I would put them as fixed factor and then subjects and face stimuli as random factor, no?

Best,
Tomás
TPalma

Posts: 9
Joined: Fri Jul 14, 2017 9:04 am

## Re: Repeated measures ANOVA and GAMLj

Can you share that mixed effects analysis with me?
TPalma

Posts: 9
Joined: Fri Jul 14, 2017 9:04 am

## Re: Repeated measures ANOVA and GAMLj

Hi
in the mixed model, there is no such a thing as "either random or fixed". Effects (coefficients) can be fixed AND random. When an effect is random, its corresponding fixed effect can be interpreted as the average effect across clusters (grouping variable levels).

here is a way to analyzed your data- You can also set the intercept as random, but you should remove race a random. If you keep them both as random, the model will not converge
Attachments
mixedrace.omv

mcfanda@gmail.com

Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm

## Re: Repeated measures ANOVA and GAMLj

I would put them as fixed factor and then subjects and face stimuli as random factor, no

You should also distinguish between random effects (random coefficients) and clustering variables. A clustering variable represents the variable that creates the clusters across which the random coefficients vary. In your case, subject and/or stimuli can be the cluster variable(s), whereas race effect or typicality effect may be random effects, meaning that they vary from subject to subject (if subject is the cluster variable) or from stimulus to stimulus (is stimuli is the clustering variable.

This is in theory, in your example, however, race and typicality cannot be both random in the same model because the model does not converge: There's not enough variance in the data to allow that. Nonetheless, you can use race as random to capture the dependency in the data

mcfanda@gmail.com

Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm

## Re: Repeated measures ANOVA and GAMLj

Hi Marcello,

Now i got it! Thanks a lot for the clarifications! I was indeed confusing random effects and clustering variables.

Best,
Tomás
TPalma

Posts: 9
Joined: Fri Jul 14, 2017 9:04 am

## Re: Repeated measures ANOVA and GAMLj

You're welcome, it's the most difficult issue in mixed models, it took me years to get it

mcfanda@gmail.com

Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm