-
Notifications
You must be signed in to change notification settings - Fork 1
/
code
28 lines (19 loc) · 1.23 KB
/
code
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
SRTdata_FINAL = readRDS('SRTdata_FINAL.rds')
require(lme4)
SRTdata_FINAL$CONDITION=as.factor(SRTdata_FINAL$CONDITION)
SRTdata_FINAL$BLOCK_TYPE=as.factor(SRTdata_FINAL$BLOCK_TYPE)
SRTdata_FINAL$ANTICIPATIONS=as.factor(SRTdata_FINAL$ANTICIPATIONS)
SRTdata_FINAL$CORRECT_ANTICIPATIONS=as.factor(SRTdata_FINAL$CORRECT_ANTICIPATIONS)
SRTdata_FINAL$CONDITION <- factor(SRTdata_FINAL$CONDITION,
levels = c(1,2),
labels = c("O-SRT", "F-SRT"))
SRTdata_FINAL$BLOCK_TYPE <- factor(SRTdata_FINAL$BLOCK_TYPE,
levels = c(0,1),
labels = c("Interfere", "Learn"))
###ANTICIPATIONS
print(summary(ANTI2 <-glmer(ANTICIPATIONS ~BLOCK_TYPE+CONDITION+(1|PARTICIPANT),data=SRTdata_FINAL, family = binomial,control=glmerControl(optimizer='bobyqa'))), cor=FALSE)
###CORRECT ANTICIPATIONS
print(summary(CORRANTI1 <-glmer(CORRECT_ANTICIPATIONS ~BLOCK_TYPE*CONDITION+(1|PARTICIPANT),data=SRTdata_FINAL, family = binomial,control=glmerControl(optimizer='bobyqa'))), cor=FALSE)
require(emmeans)
simpsl <- emmeans(CORRANTI1, ~BLOCK_TYPE*CONDITION)
contrast(simpsl, "consec", simple = "BLOCK_TYPE", combine = TRUE, adjust = "none")