-
Notifications
You must be signed in to change notification settings - Fork 0
/
data-summary-cunillera.R
31 lines (18 loc) · 1.11 KB
/
data-summary-cunillera.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library(tidyverse)
library(readr)
# TODO: confirm that these subject IDs are NOT Mturk worker ideas before releasing
# this data at all.
cunillera.data <- read_csv('data/cunillera_data.csv')
cunillera.data$correct <- as.numeric(cunillera.data$correct)
cunillera.data$anchor_condition <- factor(cunillera.data$anchor_condition, levels=c("1","0"), labels=c("anchor", "nonanchor"))
# extract data from test phase
# excluding all cases where the anchor word was tested
test.data <- cunillera.data %>% filter(phase=='test', is.na(is_anchor))
# summarize data
summary.data <- test.data %>% group_by(subject_id, anchor_condition, language_version) %>% summarize(mean.correct = mean(correct))
# main effect
cunillera.d.main <- (mean(summary.data$mean.correct) - 0.5) / sd(summary.data$mean.correct)
t.test(summary.data$mean.correct, mu = 0.5)
# moderator
summary.moderator.group <- summary.data %>% group_by(anchor_condition) %>% summarize(m = mean(mean.correct), sd = sd(mean.correct), se=sd(mean.correct)/n())
cunillera.d.moderator <- (summary.moderator.group$m[1] - summary.moderator.group$m[2]) / sd(summary.data$mean.correct)