Don’t do it
The Emotion Dataset
The effect of Emotion
Post-hoc / Contrast Analysis
Interaction
Note
Credits
Don’t do it
Ha! Got ya! Trying to run some old school ANOVAs hum? I’ll show you even better!
There is now a tremendous amount of data showing the inadequacy of ANOVAs as a statistical procedure (Camilli, 1987; Levy, 1978; Vasey, 1987; Chang, 2009). Instead, many papers suggest moving toward the mixed-modelling framework (Kristensen, 2004; Jaeger, 2008), which was shown to be more flexible, accurate, powerful and suited for psychological data.
Using this framework, we will see how we can very simply answer our questions with R and the psycho package.
The Emotion Dataset
Let’s take the example dataset included in the psycho package.
library(psycho)
library(tidyverse)
df % select(Participant_ID, Participant_Sex, Emotion_Condition, Subjective_Valence,
Recall)
summary(df)
Participant_ID Participant_Sex Emotion_Condition Subjective_Valence
10S : 48 Female:720 Negative:456 Min. :-100.000 11S : 48 Male :192 Neutral :456 1st Qu.: -65.104 12S : 48 Median : -2.604 13S : 48 Mean : -18.900 14S : 48 3rd Qu.: 7.000 15S : 48 Max. : 100.000 (Other):624 Recall Mode :logical FALSE:600 TRUE :312 Our dataframe (called df) contains data from several participants, exposed to neutral and negative pictures (the Emotion_Condition column). Each row corresponds to a single trial. As there were 48 trials per participants, there are 48 rows by participant. During each trial, the participant had to rate its emotional valence (Subjective_Valence: positive - negative) experienced during the picture presentation. Moreover, 20min after this emotional rating task, the participant was asked to freely recall all the pictures he remembered.
Our dataframe contains, for each trial, 5 variables: the name of the participant (Participant_ID), its sex (Participant_Sex), the emotion condition (Emotion_Condition), the valence rating (Subjective_Valence) and whether the participant recalled the picture (Recall).
The effect of Emotion
Does the emotion condition modulate the subjective valence? How to answer?
Whith a repeated measures ANOVA of course!
Let’s run it:
summary(aov(Subjective_Valence ~ Emotion_Condition + Error(Participant_ID/Emotion_Condition), data=df))
Error: Participant_ID
Df Sum Sq Mean Sq F value Pr(__F)
Residuals 18 115474 6415 Error: Participant_ID:Emotion_Condition
Df Sum Sq Mean Sq F value Pr(__F) Emotion_Condition 1 1278417 1278417 245.9 6.11e-12 ***
Residuals 18 93573 5198 ---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Error: Within
Df Sum Sq Mean Sq F value Pr(__F)
Residuals 874 935646 1070 Wow, we found that there is a significant effect of the emotional condition on valence ratings. We might have Science material here.
As you know, an ANOVA is pretty much a condensed linear model where the predictors are factors. Therefore, we can run an ANOVA on a linear mixed model (which includes the “error” term, or random effect).
library(lmerTest)
fit