diff --git a/ccn2019.Rmd b/ccn2019.Rmd index 51b0168..9080b91 100644 --- a/ccn2019.Rmd +++ b/ccn2019.Rmd @@ -1,20 +1,17 @@ --- -title: "Unbiased N-Back" -output: - ioslides_presentation: default - slidy_presentation: default +title: "Evaluating N-Back Sequences" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) -library(ggplot2) library(tidyverse) -library(GA) +library(ggplot2) library(stringi) - -load('./data/CL2015.RData') +library(GA) ``` +# Introduction + ## Problem - local statistical properties of the n-back affect how we respond. - local vs. global properties, what matters the most? @@ -52,7 +49,15 @@ - Continue with modeling RT and Accuracy based upon local and global feats and compare them. Which model provides a better description of the recoreded RT and Accuracy vars? (model comparasion, model selection, etc) -```{r} +The N-Back data set from @cardoso-leite2015 contains all required parameters for this study including RT, accuracy, and stimuli. + +```{r, echo=F} +load('./data/CL2015.RData') +``` + + + +```{r, include=F} trials <- c('a','b','c','d','c','d','b','a','a','d','b','a','c','c','a','c') min_len <-4 max_len <-4 @@ -122,7 +127,7 @@ sapply( 1:length(stim), function(i) { - switch(condition[i], + switch(as.character(condition[i]), "2-back" = { ifelse( stim[i]==stri_sub(history[i],-2,-2) || stim[i]==stri_sub(history[i],-4,-4), @@ -165,7 +170,11 @@ } with_skewness_score <- function(stimulus, history) { - sapply(1:length(history), function(i) 0) + sapply(1:length(history), function(i) { + trials <- stimulus[(i-str_length(history[i])):i] + trials <- unlist(trials, use.names=FALSE) + sum(sort(table(trials), decreasing = T)[1:2]) - 1 + }) } with_history <- function(stims, max=8) {