knitr::opts_chunk$set(echo = TRUE)
There are two sets of functions for the attention control tasks:
raw_
score_
Only the visual arrays task has a score_
function because the scoring for the other tasks are simply a summary statistic (mean) on performance (accuracy)
The raw_
functions will create a tidy raw data file for the task with relevant columns for you to calculate task scores and other performance measures on the task.
The score_
functions will create a scored data file for the task from the output provided by the raw_
functions.
raw_
functionsraw_antisaccade()
raw_sact()
raw_flankerDL()
raw_stroopDL()
raw_visualarrays()
data_raw <- raw_antisaccade(data_import)
Trial level variables are provided by the raw_
functions.
score_
functionsscore_visualarrays()
score_stroopDL()
Based on the output provided by the raw_
functions, the score_
functions will calculate task level scores. In order to allow for more flexibility with using the score_
functions, they will need to be combined with dplyr::group_by()
.
library(englelab) library(dplyr) library(tidyr) data_raw <- raw_visualarrays(data_import) data_scores <- data_raw %>% group_by(Subject, SetSize) %>% score_visualarrays(taskname = "VAorient_S")
Any time you use a measure of individual differences it is critical to provide reliability estimates from your sample. Here is a demonstration of how to do so with the visual arrays task.
Reliability estimates should be calculated based on the trial level data that was used to calculated an aggregated score for the task. In the visual arrays task, k scores are calculated for each set-size separately and then aggregated. One way to calculate reliability for this task would be to split trials up into even and odd, for each set-size separately. Then calculate k scores for even and odd trials, for each set-size, and aggregate even trial k scores over the two set-sizes and do the same for odd trial k scores. Then calculate spearman-brown corrected split-half reliability.
library(englelab) library(dplyr) library(tidyr) splithalf <- data_raw %>% group_by(Subject, SetSize) %>% mutate(Split = ifelse(Trial %% 2, "odd", "even")) %>% group_by(Subject, Split, SetSize) %>% score_visualarrays(taskname = "VAorient_S") %>% rowwise() %>% mutate(even = mean(c(VAorient_S_even_3.k, VAorient_S_even_5.k), na.rm = TRUE), odd = mean(c(VAorient_S_odd_3.k, VAorient_S_odd_5.k), na.rm = TRUE)) %>% ungroup() %>% summarise(r = cor(even, odd)) %>% mutate(r = (2 * r) / (1 + r))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.