Skip to content

Commit 9ba2608

Browse files
committed
Updated materials
1 parent f7630b0 commit 9ba2608

16 files changed

+11390
-0
lines changed

code/stat_analysis.R

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# install.packages(c("afex", "emmeans", "reshape2"))
2+
3+
# Load libraries
4+
library(afex)
5+
library(emmeans)
6+
library(reshape2)
7+
8+
rm(list = ls())
9+
10+
condition <- "corr"
11+
home_dir = "/Users/fzaki001/Library/CloudStorage/OneDrive-FloridaInternationalUniversity/Documents/DA/"
12+
csv_path = sprintf("%swme-face-new/wme-new-%s-anova-df.csv", home_dir, condition)
13+
df <- read.csv(csv_path)
14+
15+
df$sub = as.character(df$sub)
16+
df$response = as.factor(df$response)
17+
18+
if (condition == "corr") {
19+
df$corr = as.factor(df$corr)
20+
levels(df$corr) <- c("Corr", "Err")
21+
anova_result <- aov_car(value ~ response * corr + Error(sub/(response * corr)),
22+
data = df)
23+
emm <- emmeans(anova_result, ~ response * corr)
24+
} else if (condition == "con") {
25+
df$con = as.factor(df$con)
26+
levels(df$con) <- c("Congruent", "Incongruent")
27+
anova_result <- aov_car(value ~ response * con + Error(sub/(response * con)),
28+
data = df)
29+
emm <- emmeans(anova_result, ~ response * con)
30+
}
31+
32+
# View ANOVA table
33+
summary(anova_result)
34+
35+
# Pairwise comparisons for ResponseType within Congruency
36+
pairs(emm, by = condition)
37+
pairs(emm, by = "response")
38+
pairs(emm, adjust = "fdr")

gitignore.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Sourcedata PsychoPy files
22
/data
3+
/sourcedata
34

45
# Jupyter notebook crash files
56
**.ipynb_checkpoints

materials/letter-flanker/4.xlsx

9.66 KB
Binary file not shown.
1.6 KB
Loading
469 Bytes
Loading

materials/letter-flanker/letter-flanker.psyexp

Lines changed: 4383 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)