Reading in and minimal formatting of reaction time and accuracy data
df <- read.csv("data/3_final_merged_data/speed-acc-ss-df.csv",
check.names=F, stringsAsFactors=F)
df %<>% mutate(stimuli = ifelse(stimuli == "V1" | stimuli == "V2", "ASL",
ifelse(stimuli == "Trio", "Object",
ifelse(stimuli == "Bull", "Bullseye",
stimuli))),
stimuli = factor(stimuli, levels = c("ASL", "Face", "Object", "Bullseye")))
Calculating the proportion correct in each condition
ss_prop <- df %>%
group_by(Sub.Num, age_code, Months, language_modality,
stimuli, hearing_status_participant) %>%
filter(trial_type != "no_shift") %>%
summarise(mean_correct = mean(correct))
ss_prop <- df %>%
group_by(Sub.Num, age_code, Months, language_modality, stimuli, correct,
hearing_status_participant) %>%
filter(trial_type != "no_shift") %>%
summarise(mean_rt = mean(RT)) %>%
left_join(ss_prop)
Plot.
ms <- ss_prop %>%
filter(age_code == "child", correct == 1) %>%
group_by(language_modality, age_code, stimuli) %>%
multi_boot_standard(column = "mean_correct")
ggplot(aes(x = stimuli, y = mean, fill = language_modality), data = ms) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_linerange(aes(ymin = ci_lower, ymax = ci_upper),
position = position_dodge(width = 0.9)) +
geom_hline(yintercept = 0.5, lty = "dashed") +
xlab(NULL) +
ylab("Mean Accuracy") +
scale_fill_solarized() +
theme(text = element_text(size=30)) +
guides(fill = F) +
ggtitle("Accuracy")
Subjects in the ASL condition were most accurate, followed by Face. Subjects in the Object and Bullseye conditions were at chance, suggesting that their first saccade was a guess or otherwise random.
Calculating median reaction times for each condition
ms_rt <- ss_prop %>%
filter(age_code == "child") %>%
group_by(language_modality, age_code, stimuli, correct) %>%
multi_boot_standard(column = "mean_rt", na.rm = T, empirical_function = "median")
Plot.
ms_rt$stimuli <- factor(ms_rt$stimuli, levels = c("Bullseye", "Object", "Face", "ASL"))
ggplot(aes(x = as.factor(correct), y = median, fill = as.factor(correct)),
data = ms_rt) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_linerange(aes(ymin = ci_lower, ymax = ci_upper),
position = position_dodge(width = 0.9)) +
facet_grid(stimuli~age_code) +
scale_fill_solarized() +
guides(fill = F) +
theme(text = element_text(size=18)) +
xlab("Response Type") +
ylab("Median RT") +
coord_flip()
Subjects in the ASL condition may have been the most accurate, but they also took the longest, suggesting that they prioritize accuracy over speed. Both reaction time and accuracy were lower for Face and even lower for Object and Bullseye. This correspondance suggests that there’s a tradeoff between speed and accuracy. However, In each condition, correct responses barely seem to take longer.
Note the RT cutoff for the long tail. When you cutoff more of the tail, the difference between median correct and inccorrect shifting increases. It’s interesting to think about whether RTs in these long tails are meaningful.
med_all <- df %>%
group_by(age_code, language_modality, stimuli, correct) %>%
mutate(log_RT = log(RT)) %>%
multi_boot_standard(column = "RT", na.rm = T, empirical_function = "median")
med_all %<>% mutate(Response.Type = ifelse(correct == 1, "Correct", "Incorrect")) %>%
mutate(Response.Type = factor(Response.Type, levels = c("Incorrect", "Correct")))
df %<>% mutate(Response.Type = ifelse(correct == 1, "Correct", "Incorrect")) %>%
mutate(Response.Type = factor(Response.Type, levels = c("Incorrect", "Correct")))
ggplot(aes(x = RT, fill = Response.Type),
data = filter(df, age_code == "child")) +
geom_density(alpha = 0.7, adjust = 1.5) +
facet_grid(.~stimuli) +
geom_vline(aes(xintercept = median, color = Response.Type), size = 1, lty = "dashed",
data = filter(med_all, age_code == "child")) +
guides(color = F) +
ylab("Density") +
scale_fill_manual(values = c("orangered", "green3")) +
scale_color_manual(values = c("orangered", "green4")) +
theme(text = element_text(size=24),
legend.position = "top",
panel.margin = unit(2, "lines")) +
scale_y_continuous(breaks = c(0, .001)) +
scale_x_continuous(breaks = c(0, 1000, 2000))
Again we see evidence of a tradeoff between spped and accuracy for the ASL, Face, and maybe Bullseye conditions, but the distributions in the Object condition are right on top of each other.
If there is a tradeoff between speed and accuracy, there should be an increase in accuracy over time (possibly followed by a decrease, which would limit the difference in average reaction time by accuracy).
rt_range <- 3000
n_bins <- 10
break_seq <- seq(0, rt_range, rt_range/n_bins)
timeslice_range <- df %>%
filter(age_code == "child", is.na(RT_sec) == F) %>%
mutate(RT_bin = cut(RT, breaks = break_seq)) %>%
group_by(RT_bin, stimuli) %>%
mutate(RT_bin_avg = mean(RT, na.rm = T))
count_range <- timeslice_range %>%
group_by(RT_bin, stimuli) %>%
summarise(subjcount = n_distinct(Sub.Num), totalcount = n())
timeslice_range <- timeslice_range %>%
group_by(RT_bin_avg, stimuli, Sub.Num) %>%
summarise(ss_acc = mean(correct, na.rm=T)) %>%
group_by(RT_bin_avg, stimuli) %>%
summarise(mean = mean(ss_acc),
n = n())
ggplot(aes(x=RT_bin_avg, y=mean, weight = n,
color = stimuli, group = stimuli),
data = timeslice_range) +
geom_point(aes(size = n)) +
geom_smooth(method = "lm", formula = y ~ poly(x,2), se = FALSE) +
scale_color_solarized() +
geom_hline(yintercept = 0.5, lty = "dashed") +
xlab("Average RT") +
ylab("Proportion Correct")
There is a clear tradeoff between speed and accuracy, in all conditions accuracy increases over time. In the ASL, Face, and Object conditions, accuracy then decreases after a time, possibly explaining that lack of a difference between average accurate and inaccurate reaction times.
More subjects in the ASL condition responded later and even those that did were more accurate, further illustrating that they prioritize accuracy over speed.
However, this is not the clearest picture of the data, even when smoothed and weighted by number of individuals in each bin, bins with very few subjects have a strong influence on the curve.
Plotted by Average Reaction Time in Each Quantile
timeslices_avg <- df %>%
filter(age_code == "child", is.na(RT_sec) == F) %>%
group_by(stimuli) %>%
mutate(RT_binned = cut(RT_sec, breaks = 10),
RT_binned_q = lsr::quantileCut(RT_sec, 10)) %>%
group_by(stimuli, RT_binned_q) %>%
mutate(RT_bin_avg = mean(RT, na.rm = T))
count_avg <- timeslices_avg %>%
group_by(RT_binned_q, stimuli) %>%
summarise(subjcount = n_distinct(Sub.Num), totalcount = n())
timeslices_avg <- timeslices_avg %>%
group_by(RT_bin_avg, stimuli, Sub.Num) %>%
summarise(ss_acc = mean(correct, na.rm=T)) %>%
group_by(RT_bin_avg, stimuli) %>%
summarise(mean = mean(ss_acc), n = n())
ggplot(aes(x=RT_bin_avg, y=mean, color = stimuli, group = stimuli, weight = n), data = timeslices_avg) +
geom_point(aes(size = n)) +
geom_smooth(method = "lm", formula = y ~ poly(x,2), se = FALSE) +
scale_color_solarized() +
geom_hline(yintercept = 0.5, lty = "dashed") +
xlab("Average RT") +
ylab("Proportion Correct")
In the ASL and Face conditions there is the same pattern of an increase in accuracy followed by a decrease, further illustrating the apparent tradeoff between speed and accuracy - up to a point. In the ASL condition and especially the Face condition, there is still a sizable drop in accuracy after the initial peak. This suggests that responses after a certain point are, similarly to early responses, just guessing.
In the Object and Bullseye conditions, accuracy barely gets above chance for any reaction time, excluding a few outliers, which could easily have happened by chance and don’t factor in to the overall curve. This further illustrates that the subjects in these conditions’ initial saccades are not really an attempt to complete the task.