Exclusion of participants
df %>%
filter(group == "DYS" | (group == "TD" & is.na(other_diagnoses))) %>%
filter(!startsWith(ID, "VER")) -> df
df %>%
mutate(
exclude = case_when(
ID == "VER02" ~ 1, # ADHD - university - DYS
ID == "VER04" ~ 1, # ADHD - university - DYS
ID == "MEN12" ~ 1, # discalculia - 3rd - TD
ID == "MEN18" ~ 1, # disgrafia, discalculia - 3rd - TD
ID == "MEN26" ~ 1, # disgrafia - 5th - TD,
ID == "LAE33" ~ 1, # disgrafia, disortografia, 3rd - TD,
### new exclusion criteria:
ID == "LAE38" ~ 1,
ID == "LC19" ~ 1,
ID == "MEN29" ~ 1,
ID == "MEN02" ~ 1,
ID == "MEN10" ~ 1,
ID == "LAE23" ~ 1,
# ID == "MEN35" ~ 1,
TRUE ~ 0
)
) %>%
filter(exclude == 0) %>%
# stricter crtiteria
# filter(group.exclusion != "PR") %>%
# less strict criteria
# filter(group == "DYS" | (group == "TD" & reading.score > -2)) %>%
filter(ID != "VER01" & ID != "VER03") %>%
dplyr::select(-exclude) -> df
Inferential analysis (whole task)
Accuracy
df %>%
mutate_if(is.character, as.factor) %>%
mutate(accuracy = as.factor(accuracy),
age = scale(age),
frequency = scale(frequency),
ID = as.factor(ID),
AoO = scale(AoO)) %>%
glmer(formula = accuracy ~
# group * age +
age +
group * frequency +
AoO * group +
(1 + frequency|ID) + (1|words),
family = "binomial",
control = glmerControl(optimizer = "bobyqa")) -> m1
### Test model
#drop1(m1, test = "Chisq")
#Anova(m1, type = "III")
Anova table
|
|
Chisq
|
Df
|
Pr(>Chisq)
|
|
(Intercept)
|
98.08
|
1
|
0.000
|
|
age
|
4.56
|
1
|
0.033
|
|
group
|
33.57
|
1
|
0.000
|
|
frequency
|
30.76
|
1
|
0.000
|
|
AoO
|
6.62
|
1
|
0.010
|
|
group:frequency
|
10.66
|
1
|
0.001
|
|
group:AoO
|
4.09
|
1
|
0.043
|
|
contrast
|
frequency
|
estimate
|
SE
|
df
|
z.ratio
|
p.value
|
|
DYS - TD
|
-2
|
-0.70
|
0.22
|
Inf
|
-3.22
|
0.0013
|
|
DYS - TD
|
0
|
-1.45
|
0.25
|
Inf
|
-5.79
|
0.0000
|
|
DYS - TD
|
2
|
-2.19
|
0.43
|
Inf
|
-5.14
|
0.0000
|
|
group
|
AoO.trend
|
SE
|
df
|
asymp.LCL
|
asymp.UCL
|
z.ratio
|
p.value
|
|
DYS
|
-0.54
|
0.21
|
Inf
|
-0.95
|
-0.13
|
-2.57
|
0.010
|
|
TD
|
-0.05
|
0.11
|
Inf
|
-0.27
|
0.17
|
-0.48
|
0.628
|

RT
df %>%
mutate_if(is.character, as.factor) %>%
filter(accuracy == 1) %>%
mutate(rt = log(rt),
age = scale(age),
frequency = scale(frequency),
AoO = scale(AoO)) %>%
lmer(formula = rt ~
# group * age +
age +
#group * frequency +
frequency +
# group * AoO +
group +
AoO +
(1 |ID) + (1|words)) -> m2
### Test model
# drop1(m2, test = "Chisq")
# Anova(m2, type = "III")
Anova table
|
|
Chisq
|
Df
|
Pr(>Chisq)
|
|
(Intercept)
|
50017.26
|
1
|
0.0000
|
|
age
|
5.03
|
1
|
0.0250
|
|
frequency
|
46.87
|
1
|
0.0000
|
|
group
|
46.61
|
1
|
0.0000
|
|
AoO
|
0.93
|
1
|
0.3337
|

Descriptive Analysis
Accuracy
|
group
|
mean
|
sd
|
range
|
|
DYS
|
0.83
|
0.08
|
0.6500
|
|
DYS
|
0.83
|
0.08
|
1.0000
|
|
TD
|
0.92
|
0.05
|
0.8125
|
|
TD
|
0.92
|
0.05
|
0.9875
|
RT
|
group
|
mean
|
sd
|
range
|
|
DYS
|
9.87
|
0.30
|
9.436210
|
|
DYS
|
9.87
|
0.30
|
10.692565
|
|
TD
|
9.52
|
0.16
|
9.215017
|
|
TD
|
9.52
|
0.16
|
9.958074
|

Speed-accuracy trade-off
### create speed-accuracy score tradeoff using BIS measure
### BIS combines reaction times and error rates in a way that strongly attenuates speed-accuracy trade-offs (see the paper for details). We here provide code to calculate BIS in Matlab, R, and Excel format. If you use one of these functions, please cite: Liesefeld, H. R. & Janczyk, M. (2019). Combining speed and accuracy to control for speed-accuracy trade-offs(?). Behavior Research Methods, 51, 40-60. doi:10.3758/s13428-018-1076-x
BIS <- function(data) {
n <- length(data$group) # sample size to correct var()-function result (which uses n-1)
srt <- sqrt( ((n-1)/n) * var(data$mean_rt_c) ) # sample standard deviation across all rts
spc <- sqrt( ((n-1)/n) * var(data$pc) ) # sample standard deviation across all rts
mrt <- mean(data$mean_rt_c) # mean across all rts
mpc <- mean(data$pc) # mean across all pcs
zrt <- (data$mean_rt_c-mrt)/srt # standardized rts
zpc <- (data$pc-mpc)/spc # z-standardized pcs
data$bis <- zpc - zrt # Balanced Integration Score
return(data) # return data.frame with added variable 'bis'
}
df1 %>%
select(ID, tot.accuracy, mean.rt) %>%
rename(
group = ID,
pc = tot.accuracy,
mean_rt_c = mean.rt
) %>% BIS() %>%
select(group, bis) %>%
rename(ID = group) -> df.bis
left_join(df1, df.bis, by = "ID") -> df1
Speed-accuracy trade off
|
group
|
mean
|
sd
|
range
|
|
DYS
|
-1.50
|
2.08
|
-8.34
|
|
DYS
|
-1.50
|
2.08
|
2.28
|
|
TD
|
0.85
|
0.79
|
-0.85
|
|
TD
|
0.85
|
0.79
|
2.51
|
