1 Set up R environment

library(tidyverse)
library(ggplot2)
library(ggpubr)
library(plyr)

Set the R working drectory to the main experiment directory.

setwd("/Users/adambarnas/Box/Predicting_IB")  

2 Read-in datafiles

Read in the individual subject files.

Get a count of the number of subjects.

nrow(tbl_all %>% distinct(ID,.keep_all = FALSE))
## [1] 127

3 Cognitive Styles

Organize data

tbl_all_simple = subset(tbl_all, select = -c(rowNo,responseWindow,presTime,ISI,ITI,stimFormat,button1,keyboard,key,responseType,randomPick,responseOptions,pageBreak,required,if.,then,ITI_ms,ITI_f,ITI_fDuration,presTime_ms,presTime_f,presTime_fDuration,timestamp,responseCode,correct))

tbl_all_simple <- tbl_all_simple %>% 
  separate(response,into=c('response'))

tbl_all_simple <- tbl_all_simple %>% 
  separate(RTkeys,into=c('RTkeys'))

tbl_all_simple[tbl_all_simple==""]<-NA

tbl_all_simple$rt<- tbl_all_simple$RTkeys
tbl_all_simple$rt[is.na(tbl_all_simple$rt)] <- tbl_all_simple$RT[is.na(tbl_all_simple$rt)]

tbl_all_simple$rt  <- as.numeric(tbl_all_simple$rt)
tbl_all_simple$ID  <- as.character(tbl_all_simple$ID)
tbl_all_simple$stim1  <- as.character(tbl_all_simple$stim1)

tbl_all_blank_removed <- tbl_all_simple %>% 
  filter(stim1 != "blank")

tbl_all_cog_style <- tbl_all_blank_removed %>% 
  filter(grepl('embedded|matching', stim1))

tbl_all_cog_style[tbl_all_cog_style== "embedded_prompt" ] <- NA
tbl_all_cog_style[tbl_all_cog_style== "matching_prompt" ] <- NA
tbl_all_cog_style[tbl_all_cog_style== "timeout" ] <- NA

tbl_all_cog_style <- tbl_all_cog_style %>% 
  group_by(ID) %>% 
  fill(stim1) %>% #default direction down
  fill(stim1, .direction = "up")

tbl_all_cog_style_condensed <- tbl_all_cog_style %>% 
  group_by(ID, stim1) %>% 
  dplyr::summarise(RT = sum(rt), response = first(na.omit(response)))

Split up the cognitive styles stimuli nomenclature to task, answer, and number. Filter the two cognitive styles tasks.

tbl_all_cog_style_condensed <- tbl_all_cog_style_condensed %>%
  separate(stim1,into=c('task', 'answer', 'number'))

3.1 Analyze accuracy

In the matching figures task, subjects were instructed to press ‘F’ if the two complex shapes were the same and ‘J’ if the two complex shapes were different. Trials will be labeled 1 for correct responses (‘F’ for same objects and ‘J’ for different objects) and 0 for incorrect responses (‘F’ for different objects and ‘J’ for same objects).

In the embedded figures task, subjects were instructed to press ‘F’ if the simple shape is within the complex shape and ‘J’ if the the simple shape is not within the complex shape. Trials will be labeled 1 for correct responses (‘F’ for simple within complex and ‘J’ for simple not within complex) and 0 for incorrect responses (‘F’ simple not within complex and ‘J’ simple within complex).

tbl_all_cog_style_condensed$acc = "filler"

for (i in 1:length(tbl_all_cog_style_condensed$ID)){
  if (tbl_all_cog_style_condensed$task[i] == "matching"){
    if (tbl_all_cog_style_condensed$answer[i] == "same"){
      if (tbl_all_cog_style_condensed$response[i] == "f"){
        tbl_all_cog_style_condensed$acc[i] = 1
    } else {
        tbl_all_cog_style_condensed$acc[i] = 0
    }
    } else {
      if (tbl_all_cog_style_condensed$response[i] == "j"){
        tbl_all_cog_style_condensed$acc[i] = 1
    } else {
        tbl_all_cog_style_condensed$acc[i] = 0
    }
  }
  }
  if (tbl_all_cog_style_condensed$task[i] == "embedded"){
    if (tbl_all_cog_style_condensed$answer[i] == "yes"){
      if (tbl_all_cog_style_condensed$response[i] == "f"){
        tbl_all_cog_style_condensed$acc[i] = 1
    } else {
        tbl_all_cog_style_condensed$acc[i] = 0
    }
    } else {
      if (tbl_all_cog_style_condensed$response[i] == "j"){
        tbl_all_cog_style_condensed$acc[i] = 1
    } else {
        tbl_all_cog_style_condensed$acc[i] = 0
    }
  }
  }
}

write.csv(tbl_all_cog_style_condensed,'embedded_matching_data.csv', row.names=FALSE)

3.2 Plot accuracy

tbl_all_cog_style_condensed_acc <- tbl_all_cog_style_condensed %>%
  group_by(ID,task,acc) %>%
  dplyr::summarize(counts = n()) %>%
  spread(acc,counts) %>% 
  mutate(total = rowSums(.[3:4], na.rm = TRUE))
colnames(tbl_all_cog_style_condensed_acc) <- c("ID", "task", "inacc", "acc", "total")
tbl_all_cog_style_condensed_acc[is.na(tbl_all_cog_style_condensed_acc)] <- 0
tbl_all_cog_style_condensed_acc$rate <- tbl_all_cog_style_condensed_acc$acc / tbl_all_cog_style_condensed_acc$total

tbl_all_cog_style_condensed_acc %>%
  ggbarplot("ID", "rate", fill = "task", color = "task", palette = c("#0d2240", "#00a8e1"), font.xtickslab = 4, ylab = "Accuracy", ylim = c(0, 1), position = position_dodge(0.8)) + rotate_x_text() + geom_hline(yintercept = .5, linetype = 2)

tbl_all_cog_style_condensed_acc %>%
  ggbarplot("task", "rate", add = "mean_se",fill = "task", color = "task", palette = c("#0d2240", "#00a8e1"), ylab = "Accuracy", ylim = c(0, 1), position = position_dodge(0.8)) + geom_hline(yintercept = .5, linetype = 2)

embedded_chance_sona <- tbl_all_cog_style_condensed_acc %>% 
  filter(task =="embedded")
embedded_chance_sona <-t.test(embedded_chance_sona$rate, mu = .50, alternative="greater")
embedded_chance_sona
## 
##  One Sample t-test
## 
## data:  embedded_chance_sona$rate
## t = 17.767, df = 126, p-value < 2.2e-16
## alternative hypothesis: true mean is greater than 0.5
## 95 percent confidence interval:
##  0.7479248       Inf
## sample estimates:
## mean of x 
## 0.7734252
matching_chance_sona <- tbl_all_cog_style_condensed_acc %>% 
  filter(task =="matching")
matching_chance_sona <-t.test(matching_chance_sona$rate, mu = .50, alternative="greater")
matching_chance_sona
## 
##  One Sample t-test
## 
## data:  matching_chance_sona$rate
## t = 17.153, df = 126, p-value < 2.2e-16
## alternative hypothesis: true mean is greater than 0.5
## 95 percent confidence interval:
##  0.7023753       Inf
## sample estimates:
## mean of x 
## 0.7240157
tbl_all_cog_style_condensed_acc %>% 
  with(t.test(rate~task,paired=TRUE))
## 
##  Paired t-test
## 
## data:  rate by task
## t = 5.1607, df = 126, p-value = 9.306e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.03046237 0.06835653
## sample estimates:
## mean of the differences 
##              0.04940945

3.3 Remove subjects below chance

tbl_all_cog_style_condensed_acc <- subset(tbl_all_cog_style_condensed_acc, select = c(ID, task, rate))
tbl_all_cog_style_condensed_acc_wide <- tbl_all_cog_style_condensed_acc %>%
  spread(task,rate)

tbl_all_cog_style_condensed_acc <- tbl_all_cog_style_condensed_acc_wide
#  filter(embedded > 0.5 & matching > 0.5)

tbl_all_cog_style_condensed_acc <- gather(tbl_all_cog_style_condensed_acc, task, rate, embedded:matching, factor_key=TRUE)

tbl_all_cog_style_condensed_acc %>%
  ggbarplot("ID", "rate", fill = "task", color = "task", palette = c("#0d2240", "#00a8e1"), font.xtickslab = 4, ylab = "Accuracy", ylim = c(0, 1), position = position_dodge(0.8)) + rotate_x_text() + geom_hline(yintercept = .5, linetype = 2)

tbl_all_cog_style_condensed_acc %>%
  ggbarplot("task", "rate", add = "mean_se",fill = "task", color = "task", palette = c("#0d2240", "#00a8e1"), ylab = "Accuracy", ylim = c(0, 1), position = position_dodge(0.8)) + geom_hline(yintercept = .5, linetype = 2)

embedded_chance_sona <- tbl_all_cog_style_condensed_acc %>% 
  filter(task =="embedded")
embedded_chance_sona <-t.test(embedded_chance_sona$rate, mu = .50, alternative="greater")
embedded_chance_sona
## 
##  One Sample t-test
## 
## data:  embedded_chance_sona$rate
## t = 17.767, df = 126, p-value < 2.2e-16
## alternative hypothesis: true mean is greater than 0.5
## 95 percent confidence interval:
##  0.7479248       Inf
## sample estimates:
## mean of x 
## 0.7734252
matching_chance_sona <- tbl_all_cog_style_condensed_acc %>% 
  filter(task =="matching")
matching_chance_sona <-t.test(matching_chance_sona$rate, mu = .50, alternative="greater")
matching_chance_sona
## 
##  One Sample t-test
## 
## data:  matching_chance_sona$rate
## t = 17.153, df = 126, p-value < 2.2e-16
## alternative hypothesis: true mean is greater than 0.5
## 95 percent confidence interval:
##  0.7023753       Inf
## sample estimates:
## mean of x 
## 0.7240157
tbl_all_cog_style_condensed_acc %>% 
  with(t.test(rate~task,paired=TRUE))
## 
##  Paired t-test
## 
## data:  rate by task
## t = 5.1607, df = 126, p-value = 9.306e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.03046237 0.06835653
## sample estimates:
## mean of the differences 
##              0.04940945

3.4 Plot RTs

tbl_all_cog_style_condensed_rts <- tbl_all_cog_style_condensed[(tbl_all_cog_style_condensed$ID %in% tbl_all_cog_style_condensed_acc$ID),] %>% 
  filter(acc == 1)

tbl_all_cog_style_condensed_rts %>%
  ggbarplot("ID", "RT", fill = "task", color = "task", palette = c("#0d2240", "#00a8e1"), font.xtickslab = 4, add = "median", position = position_dodge(0.8), ylab = "Median RT (ms)", ylim = c(0,6000)) + rotate_x_text()

tbl_all_cog_style_condensed_rts %>%
  ggbarplot("task", "RT", add = "median",fill = "task", color = "task", palette = c("#0d2240", "#00a8e1"), position = position_dodge(0.8), order = c("embedded", "matching"), ylab = "Median RT (ms)", ylim = c(0,5000))

tbl_all_cog_style_condensed_rts_median <- tbl_all_cog_style_condensed_rts %>%
  group_by(ID,task) %>%
  dplyr::summarize(median_rt = median(RT, na.rm=TRUE))

tbl_all_cog_style_condensed_rts_median %>% 
  with(t.test(median_rt~task,paired=TRUE))
## 
##  Paired t-test
## 
## data:  median_rt by task
## t = -15.53, df = 126, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -1260.7175  -975.7313
## sample estimates:
## mean of the differences 
##               -1118.224

3.5 Compute cognitive style ratio

The wholist-analytic ratio is calculated by dividing the median response latency to items in the matching figures task (wholist) by the median response latency to items in the embedded figures task (analytic) A ratio of below 1 indicates that an individual responded relatively faster to the matching figure items, corresponding to a wholist profile; a ratio of above 1 indicates that an individual responded relatively faster to the embedded figure items, corresponding to a analytic profile.

tbl_all_cog_style_condensed_rts_median <- tbl_all_cog_style_condensed_rts_median %>% 
  spread(task, median_rt)
tbl_all_cog_style_condensed_rts_median$ratio <- tbl_all_cog_style_condensed_rts_median$matching / tbl_all_cog_style_condensed_rts_median$embedded

tbl_all_cog_style_condensed_rts_median$style = "filler"
for (i in 1:length(tbl_all_cog_style_condensed_rts_median$ID)){
  if (tbl_all_cog_style_condensed_rts_median$ratio[i] > 1){
    tbl_all_cog_style_condensed_rts_median$style[i] = "analytic"
  } else {
    tbl_all_cog_style_condensed_rts_median$style[i] = "wholist"
  }
}

tbl_all_cog_style_condensed_rts_median %>%
  ggbarplot("ID", "ratio", fill = "#f7a800", color = "#f7a800", ylim = c(0,4), font.xtickslab = 4, ylab = "Median wholist-analytic ratio") + rotate_x_text() + geom_hline(yintercept = 1, linetype = 2)

table(tbl_all_cog_style_condensed_rts_median$style)
## 
## analytic  wholist 
##      120        7

4 IB performance

tbl_all_IB <- tbl_all %>% 
  filter(grepl('Did you notice|item', head))
tbl_all_IB = subset(tbl_all_IB, select = -c(stim1,ITI,ISI,presTime,if.,then,presTime_ms,presTime_f,presTime_fDuration,RTkeys,correct,stimFormat,button1,keyboard,key,responseWindow,randomBlock,responseType,randomPick,responseOptions,pageBreak,required,ITI_ms,ITI_f,ITI_fDuration,responseCode))

tbl_all_IB <- tbl_all_IB[(tbl_all_IB$ID %in% tbl_all_cog_style_condensed_rts_median$ID),]

4.1 Counting task

tbl_all_counting <- tbl_all %>% 
  filter(rowNo >= 406 & rowNo <= 433)
tbl_all_counting = subset(tbl_all_counting, select = -c(rowNo,type,timestamp,RT,correct,ISI,ITI,stimFormat,button1,keyboard,key,responseWindow,randomBlock,presTime,head,responseType,randomPick,responseOptions,pageBreak,required,if.,then,ITI_ms,ITI_f,ITI_fDuration,presTime_ms,presTime_f,presTime_fDuration,RTkeys,responseCode))

tbl_all_counting <- tbl_all_counting[(tbl_all_counting$ID %in% tbl_all_cog_style_condensed_rts_median$ID),]

tbl_all_counting <- cbind(tbl_all_counting[c(TRUE, FALSE), ],tbl_all_counting[c(FALSE, TRUE), ])

tbl_all_counting = subset(tbl_all_counting, select = -c(3:5))

tbl_counts <- read_csv("./IB_stims/IB_counting.csv")
## Parsed with column specification:
## cols(
##   stim1 = col_character(),
##   count = col_double()
## )
tbl_counts_comparison <- full_join(tbl_all_counting, tbl_counts, by = "stim1")
tbl_counts_comparison <- tbl_counts_comparison[complete.cases(tbl_counts_comparison), ]

tbl_counts_comparison$response  <- as.numeric(tbl_counts_comparison$response)
## Warning: NAs introduced by coercion
tbl_counts_comparison$count  <- as.numeric(tbl_counts_comparison$count)

tbl_counts_comparison[is.na(tbl_counts_comparison)] <- 0

tbl_counts_comparison$error <- (abs(tbl_counts_comparison$response - tbl_counts_comparison$count) / tbl_counts_comparison$count) * 100

tbl_counts_comparison %>%
  ggbarplot("ID", "error", fill = "#f7a800", color = "#f7a800", ylim = c(0,150), font.xtickslab = 4, add = "mean_se", ylab = "Mean Percent Error on Midline-crossings Task") + rotate_x_text() + geom_hline(yintercept = 20, linetype = 2)

tbl_counts_comparison_average <- tbl_counts_comparison %>% 
  group_by(ID) %>% 
  dplyr::summarize(mean_error = mean(error, na.rm=TRUE))

tbl_counts_comparison_average %>%
  ggbarplot(y = "mean_error", fill = "#f7a800", color = "#f7a800", ylim = c(0,100), sort.val = c("asc") ,xlab = "Group", add = "mean_se", ylab = "Mean Percent Error on Midline-crossings Task")

error <-t.test(tbl_counts_comparison_average$mean_error, mu = 0, alternative="greater")
error
## 
##  One Sample t-test
## 
## data:  tbl_counts_comparison_average$mean_error
## t = 9.4878, df = 126, p-value < 2.2e-16
## alternative hypothesis: true mean is greater than 0
## 95 percent confidence interval:
##  23.48205      Inf
## sample estimates:
## mean of x 
##  28.45099
write.csv(tbl_counts_comparison,'IB_counting.csv', row.names=FALSE)

4.2 Remove subjects greater than 50%

tbl_counts_comparison_average_good <- tbl_counts_comparison_average
#  filter(mean_error < 20)

tbl_counts_comparison_good <- tbl_counts_comparison[(tbl_counts_comparison$ID %in% tbl_counts_comparison_average_good$ID),]

tbl_counts_comparison_good %>%
  ggbarplot("ID", "error", fill = "#f7a800", color = "#f7a800", ylim = c(0,30), font.xtickslab = 6, add = "mean_se", ylab = "Mean Percent Error on Midline-crossings Task") + rotate_x_text()

tbl_counts_comparison_average_good %>%
  ggbarplot(y = "mean_error", fill = "#f7a800", color = "#f7a800", ylim = c(0,100), sort.val = c("asc") ,xlab = "Group", add = "mean_se", ylab = "Mean Percent Error on Midline-crossings Task")

error_good <-t.test(tbl_counts_comparison_average_good$mean_error, mu = 0, alternative="greater")
error_good
## 
##  One Sample t-test
## 
## data:  tbl_counts_comparison_average_good$mean_error
## t = 9.4878, df = 126, p-value < 2.2e-16
## alternative hypothesis: true mean is greater than 0
## 95 percent confidence interval:
##  23.48205      Inf
## sample estimates:
## mean of x 
##  28.45099

4.3 Noticers vs. Non-noticers

tbl_all_IB <- tbl_all_IB[(tbl_all_IB$ID %in% tbl_counts_comparison_average_good$ID),]

tbl_all_notice <- tbl_all_IB %>% 
  filter(grepl('items', head))
table(tbl_all_notice$response)
## 
##       No Not sure      Yes 
##       47       30       50
tbl_all_notice = subset(tbl_all_notice, select = -c(rowNo,type,head,timestamp,RT))

4.4 Unexpected event description

tbl_all_event <- tbl_all_IB %>% 
  filter(grepl('moved', head))
tbl_all_different <- tbl_all_IB %>% 
  filter(grepl('different', head))
tbl_all_event <- cbind.data.frame(tbl_all_event[1], tbl_all_event[6])
tbl_all_different <- cbind.data.frame(tbl_all_different[1], tbl_all_different[6])
tbl_all_event <- cbind.data.frame(tbl_all_different, tbl_all_notice[2], tbl_all_event[2])
colnames(tbl_all_event) <- c("ID", "notice_anything_different", "unexpected_item", "item_description")
tbl_all_event <- arrange(tbl_all_event, ID)
tbl_all_event$noticer_or_nonnoticer <- c(0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0)
knitr::kable(tbl_all_event)
ID notice_anything_different unexpected_item item_description noticer_or_nonnoticer
A11PIARI7WALAX No Not sure I did not see anything. I was purely focused on white shapes. 0
A12BPNWOK3NZT9 The trial itself was much different. I get the feeling that something was going on in the background but I was too busy counting the letters. Not sure I am not sure. I know I saw letters inside the box but I’m wondering if there were letters anywhere else. 0
A12WYOBHTYIELS none Yes none 0
A15XIKX3PI7SLK On the first two trials, I had to compare two shapes, while on the last trial, I had to count the number of times letters cross a line. No I did not notice any of the items. 0
A171RZ3O028XF6 I did not notice anything different Not sure maybe the E or plus sign 0
A17CTPL658MHXG a plus sign moved across the screen Yes a plus sign moved from the right to the left of the screen 1
A17LF7GCAFYMSL i saw a symbol of plus on this last trial Yes i saw a plus symbol moving from the right hands side to the left 1
A18E16UFE351U6 I didn’t notice anything different on the last trial. Not sure I don’t think noticed any of those symbols in the last trial. 0
A1969Q0R4Y0E3J No. Not sure I am guessing one of those items were present and moved at a slower rate than others. 0
A198MSVO1VTAT5 No, I didn’t notice anything different. No I didn’t notice it at all. I was watching the L T. 0
A1AF25FCVKC87X The cross was moving right to left. Yes It was a cross and it moved on the line from right to left. 1
A1BH6H9WRK49I No No Didn’t see the item 0
A1IQUHRI7G63YF it involved letters Yes The plus sign appeared on the line 1
A1JJYY622DGE5L There were letters rather than shapes to deal with. Yes There was a + sign in the middle of the purple line. It never moved. 0
A1JR35HATOEME9 No Yes They moved slower 0
A1KYE1G3X1TYOA good Yes good 0
A1M8HPA2YRBSEN Nothing different. Not sure I’m not sure about that. 0
A1N0Q3QP4OMTZ2 I noticed a grey cross moving across the center line at one point. Yes It moved right on the center line, and it was the third image (grey cross). 1
A1NG105OCI7YJH Nothing Yes guess 0
A1O0BGHFTMPQM0 NO No DIDN’T NOTICE IT 0
A1P3HHEXWNLJMP No I failed to notice anything different. I am guessing that maybe the shapes changed color. No I did not notice it at all. 0
A1Q4ZOXZ0Y7K6I There was a gray plus/cross shape that moved on the line Yes I saw a gray plus shape moving from right to left on the line 1
A1QKIA8XRNEXIG No Not sure I’m not sure, I didn’t notice any unusual items in the animation 0
A1ROEDVMTO9Y3X no Not sure no 0
A1RQLE4ZMTU22A I did not notice anything different. Not sure I’d say it was the X if I was to guess. I have no idea how it moved. 0
A1SHLWKA0UH1IS It had moving objects. Also I had to type in a number instead of clicking a letter. No I did not notice it. 0
A1TKEQDOVT6CQC VERY NICE AND GOOD. Yes GOOD 0
A1U4DNYKF6YUY3 A dark gray cross/plus sign/+ traveled along the center line. Yes +, moved along the center horizontal line from the right to the left. 1
A1W7I6FN183I8F No, I did not notice anything different. Then again, my attention was focused on the white shapes crossing. No I did not see those letters/equation appear at all while I was counting. 0
A1W8DDT395VL3A Yes somewhat different Yes E top and down 0
A1XK77VP2S13YC no Not sure I didnt see it 0
A1YFVXP4A1CXSF none, except for that they were completely different tasks. No just the plus sign, I thought it stayed in the center 1
A22VZZFOP9D3GC NO No x 0
A23EJ7F1UP09VO no No yes 0
A248QG4DPULP46 Yes. The last trial involved counting moving shapes while the shapes in the two other trials did not move. Not sure I don’t think I saw any of the shapes. I was concentrating on counting the white figures that crossed the line. 0
A24CDDRCS256SR good Yes good 0
A258ZJM0HU1OR3 Yes entirely different. The main different is to count the white shape letters in the last task. first and second task to say same or different. Yes X and + I can see to travel left to right and bottom to top. 0
A26BNL983RC4YZ no No no 0
A270HX8LH9LJ8W no Not sure I didn’t consciously see one of those items. 0
A279YSE7NB16M0 no No no 0
A28AXX4NCWPH1F A cross moved across the line. Yes X 1
A297OTX4PW0XS3 Just that it was a completely different task from the first two. I was counting the number of times white letters crossed a line instead of comparing shapes. Yes The plus symbol moved along the line from one side to the other. 1
A2APG8MSLJ6G2K no, sorry. there was a different letter i bet. No i didnt see it, sorry. 0
A2BBFG0J0TJI78 No, I did not notice any difference. Not sure I did not see them 0
A2DFN1612YMN00 I noticed a grey cross slide across the horizontal line. Yes I think I saw a grey cross go across the blue horizontal line on the last test. 1
A2FOYHZ7HOFKBI No difference Not sure Didn’t see any of the items, I was too focused on the white letters 0
A2GOS6NF74E2ST No No No, I didn’t see anything 0
A2H9ZRBC0JYKVJ i saw a plus sign crossing from right to left. Yes Plus sign 1
A2HDDHOOCUCN9P There was an animation rather than still shapes, and the shapes were letters T and L. No I did not see X, +, or E. 0
A2HJDLSU95MH8Q no Not sure no idea, sorry 0
A2HRUFTA09371Y there was a + moving from right to left on the screen Yes #NAME? 1
A2I6ZALE49CVSC a cross went across the screen Yes It just moved across the screen 1
A2JW59JRBWUMR2 NO Not sure X 0
A2K287FPB9YFIE counting white crosses. No I didn’t pay attention to the dark symbols. 0
A2OPYRV3GLAPS1 I did not! No I didn’t notice anything. 0
A2OVMMDZQ524IL none Yes + 1
A2OX8TSRCU6NKD no No I did not see anything different but if there was my guess was it didn’t move 0
A2POU9TTW177VH No No I did not see it 0
A2R75YFKVALBXE Didn’t notice anything different. No Didn’t see it. 0
A2U3H5KUYAQN24 nope Yes nope 0
A2UYZFH5VT5R3H no Yes A cross shape moved through the center 1
A2VE9POLQW9DJN no Yes going fast 0
A2VNSNAN1LZBAM Maybe the shapes moved faster? I’m not really sure. No I didn’t see that. 0
A2VO8C41JJIQY9 There was less number of black characters in the animation. Not sure I think I saw the black faded character “E” and it was moving up and down. 0
A2W02ACKYETLOA There was some kind of undefined shapes were coming. Yes some of letters were moving 0
A2WN3818G61T2J good Yes godod 0
A2X8CQ41UG5ET6 good different Yes yes, good 0
A2XQ3CFB5HT2ZQ I did not notice. Not sure no idea 0
A2YPASLVG5CA96 good Yes nice 0
A2ZDEERVRN5AMC nope. No I was too focused on the purple line. 0
A2ZN2GY1G3V631 it was difficult Yes L 0
A304YZ6SS1BEVV nothing No t and l 0
A314XJY8V1YL12 they recrossed the line several times. Not sure I’m not sure, the T’s and L’s seemed to move in a circle or wave pattern. 0
A31JM9RECQGYEX Different goal Yes none of them were present 0
A3211VPCMNHVL5 none Not sure not sure 0
A322RYFSXVYMRV Nothing Not sure I don’t remember 0
A33GZPUI8YJI0L good task but some hard Yes good task 0
A348NEQKS6VNIB I didn’t notice anything different in the trials. Yes I saw the x on the screen in the last trial. 0
A36IKCEEOJ0KQ3 very like Yes no 0
A37BGU8FSIP4I6 none No T L 0
A38TC65E7RWEFW Good Yes tl 0
A3APKUC67F9IMW They all started too quick. I was caught off guard most of the time. I guess that’s what the study is or my internet is slow? No clue. Not sure I’m sure I saw crosses but not in the dimensions or rotation that you have there. You got me worried when you hit me right in the gut immediately. 0
A3BHRFFG75X3GO no Not sure I did not notice any of that. 0
A3EC3OP6U52JYC In the last trial, I noticed a moving gray cross. The gray cross ran across the middle from right to left. Yes I saw a gray cross move from right to left across the middle of the screen. 1
A3EZ3BRM1C5WKV There more crossings by white letters. No X moved up and down 0
A3HMHNZHE46CZQ Yes,it was different. In 1st trial, there was clicking yes or no option only. But in last trial, we had to count number of times white is crossed the horizontal lines No I think some of the letter are moving but not sure to tell about it 0
A3HZFB2JLF3JMY no Not sure not sure 0
A3I448WWTX2A2D NOTHING Yes + 1
A3IF13XHP5UPO2 Maybe required the most attention. No I didn’t see any of the previous letters. 0
A3IXWFXJC2YKU7 No. Not sure The large X perhaps 0
A3K9GTQBOI7O5A no not really No NA 0
A3L2FPKRD46FRW no not really No L and T 0
A3LT7W355XOAKF no No x, only a guess, moved the same as the others 0
A3M6YNC0RI36QY no Not sure moved randomly 0
A3N0QZ9ZKUCTCQ There was a moving cross from the right to the left in the center. Yes Plus sign, moving slowly right to left. 1
A3OP24TYKA619W i did not notice anything No i did not see it. too busy concentrating 0
A3P57IUDHUKNCE no Yes e 0
A3RHJEMZ4EGY2U No, I was too busy trying to count. Not sure It seemed that something was moving faster but I have no idea what it was because I was busy trying to count. 0
A3SJVR4BROAIJO They included moving letters rather than static shapes. No I did not see any of those items. 0
A3T9QXFQ55NER5 no No no 0
A3V2XCDF45VN9X no Not sure I did not notice. 0
A82Q1HS5CPZ5I different type of task, last one is counting, while the other previous two are check if shapes are similar Yes #NAME? 0
A9ZCY6FLUCIU1 different type of measurement, no yes or no No not sure saw 0
AABCSDU3TZLNG No. This last L-and-T trial? No. No N/A. I didn’t see it. 0
ACKG8OU1KHKO2 a plus sign moving right to left on the line Yes plus sign moved on the left side on the line. 1
ACOLGCHEE4C4K Good task Yes good moved the plus 1
ACZA9ZCVQ5FRU none No Only noticed the T and L moving up and down. 0
AD1WGUMVD6KED I didn’t notice anything different. Not sure I think there was a plus sign somewhere. 1
AD21ES5UMD77U The movement and the focusing on one color. No I did not see any of the previous items 0
ADWJTFRSEDLU6 no No good 0
AEQ6KLNVTRKKR The grey cross was moving across the screen. Yes The addition sign was moving from right to left across the line in the middle of the screen. 1
AFIK3VBMMX6G6 gray plus sign went from right to left on horizontal bisector Yes plus sign, right to left 1
AFN81UBWVTVNR nothing Yes + 1
AI5RMOS8R652G No, I didn’t notice anything different. No I didn’t see anything different I was paying too much attention to white passing through the line. 0
AIVCONP5S4OKQ nothing Yes i will be stuty 0
AKVDK30EEV08C No No I didn’t notice anything different. 0
ALJXMXZYDT1UY no No no 0
ALKQPW0O9C98N No No I don’t think I saw any of them 0
AM8OWAW9TUVLN the shapes moved differently each round No I just watched the white ones and forgot what they were 0
AMPMTF5IAAMK8 N/A Yes an x moved on a horizontal line 0
AOJPRTHGMEPFX A cross traveled across the screen from right to left. Yes Middle, from right to left 1
AONN1W54VC8YD There was a moving + across the screen. Yes The + symbol moved to left, along the line. 1
AP4FDDWBJW47O Slower No None 0
AQN3WMCEA96DQ I didn’t notice anything. Not sure I was only paying attention to the white figures. Maybe an X crossed the screen though. just a guess 0
AXXYCRSMYHH4U it was play to easy. No i saw T and L .It was moved zig zag 0
AYFDUTHXE54I The letters are moving in the last task not matching drawings. No I saw letters T L crossing a center line where as L is in white color. 0
AZ0X586OXPUW0 Nothing No T and L 0
table(tbl_all_event$noticer_or_nonnoticer)
## 
##   0   1 
## 100  27
write.csv(tbl_all_event,'IB_notice.csv', row.names=FALSE)

5 Post IB questions

5.1 Expecting an unexpected event

tbl_all <- tbl_all[(tbl_all$ID %in% tbl_all_IB$ID),]

tbl_all_expecting <- tbl_all %>% 
  filter(grepl('Before', head))
tbl_all_expecting = subset(tbl_all_expecting, select = -c(stim1,ITI,ISI,presTime,if.,then,presTime_ms,presTime_f,presTime_fDuration,RTkeys,correct,stimFormat,button1,keyboard,key,responseWindow,randomBlock,responseType,randomPick,responseOptions,pageBreak,required,ITI_ms,ITI_f,ITI_fDuration,responseCode))

tbl_all_expecting <- tbl_all_expecting[(tbl_all_expecting$ID %in% tbl_all_cog_style_condensed_rts_median$ID),]

table(tbl_all_expecting$response)
## 
##  No Yes 
## 101  26

5.2 Familiarity with IB experiments

tbl_all_familiarity <- tbl_all %>% 
  filter(grepl('gorilla', head))
tbl_all_familiarity = subset(tbl_all_familiarity, select = -c(stim1,ITI,ISI,presTime,if.,then,presTime_ms,presTime_f,presTime_fDuration,RTkeys,correct,stimFormat,button1,keyboard,key,responseWindow,randomBlock,responseType,randomPick,responseOptions,pageBreak,required,ITI_ms,ITI_f,ITI_fDuration,responseCode))

tbl_all_familiarity <- tbl_all_familiarity[(tbl_all_familiarity$ID %in% tbl_all_cog_style_condensed_rts_median$ID),]

table(tbl_all_familiarity$response)
## 
##  No Yes 
##  85  42

6 Cognitive style ratio predicting IB

tbl_all_cog_style_condensed_rts_median <- tbl_all_cog_style_condensed_rts_median[(tbl_all_cog_style_condensed_rts_median$ID %in% tbl_all_event$ID),]

tbl_log_reg_median <- cbind.data.frame(tbl_all_cog_style_condensed_rts_median, tbl_all_event[5])

#tbl_log_reg_median[tbl_log_reg_median == "Yes"] <- 1
#tbl_log_reg_median[tbl_log_reg_median == "No"] <- 0
#tbl_log_reg_median[tbl_log_reg_median == "Not sure"] <- 0
names(tbl_log_reg_median)[names(tbl_log_reg_median)=="noticer_or_nonnoticer"] <- "notice"
tbl_log_reg_median$notice <- as.numeric(tbl_log_reg_median$notice)

6.1 Median RTs

6.1.1 Logistic regression w/ median RT ratio

log_reg_median_ratio <- glm(notice ~ ratio, data = tbl_log_reg_median, family = binomial(link = "logit"))
summary(log_reg_median_ratio)
## 
## Call:
## glm(formula = notice ~ ratio, family = binomial(link = "logit"), 
##     data = tbl_log_reg_median)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.7037  -0.6944  -0.6908  -0.6855   1.7753  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -1.26486    0.36917  -3.426 0.000612 ***
## ratio       -0.02401    0.16256  -0.148 0.882577    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 131.41  on 126  degrees of freedom
## Residual deviance: 131.39  on 125  degrees of freedom
## AIC: 135.39
## 
## Number of Fisher Scoring iterations: 4
plot_median_ratio <- ggplot(tbl_log_reg_median, aes(x=ratio, y=notice)) + xlim(1,4) + geom_point() + stat_smooth(method="glm", method.args=list(family="binomial"), se=TRUE, color="#f7a800") + theme_classic((base_size = 15))
suppressMessages(print(plot_median_ratio))
## Warning: Removed 8 rows containing non-finite values (stat_smooth).
## Warning: Removed 8 rows containing missing values (geom_point).

6.1.2 Logistic regression w/ embedded median RT

log_reg_embedded_median <- glm(notice ~ embedded, data = tbl_log_reg_median, family = binomial(link = "logit"))
summary(log_reg_embedded_median)
## 
## Call:
## glm(formula = notice ~ embedded, family = binomial(link = "logit"), 
##     data = tbl_log_reg_median)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.7766  -0.7080  -0.6824  -0.5982   1.8044  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -1.6596122  0.6665773  -2.490   0.0128 *
## embedded     0.0002326  0.0004132   0.563   0.5734  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 131.41  on 126  degrees of freedom
## Residual deviance: 131.09  on 125  degrees of freedom
## AIC: 135.09
## 
## Number of Fisher Scoring iterations: 4
plot_embedded_median <- ggplot(tbl_log_reg_median, aes(x=embedded, y=notice)) + geom_point() + stat_smooth(method="glm", method.args=list(family="binomial"), se=TRUE, color="#f7a800") + theme_classic((base_size = 15))
suppressMessages(print(plot_embedded_median))

6.1.3 Logistic regression w/ matching median RT

log_reg_matching_median <- glm(notice ~ matching, data = tbl_log_reg_median, family = binomial(link = "logit"))
summary(log_reg_matching_median)
## 
## Call:
## glm(formula = notice ~ matching, family = binomial(link = "logit"), 
##     data = tbl_log_reg_median)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8518  -0.7214  -0.6733  -0.5366   1.8984  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)   
## (Intercept) -1.8951774  0.6068528  -3.123  0.00179 **
## matching     0.0002186  0.0002057   1.063  0.28790   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 131.41  on 126  degrees of freedom
## Residual deviance: 130.25  on 125  degrees of freedom
## AIC: 134.25
## 
## Number of Fisher Scoring iterations: 4
plot_matching_median <- ggplot(tbl_log_reg_median, aes(x=matching, y=notice)) + geom_point() + stat_smooth(method="glm", method.args=list(family="binomial"), se=TRUE, color="#f7a800") + theme_classic((base_size = 15))
suppressMessages(print(plot_matching_median))

6.1.4 Logistic regression (Dichotomous predictor, dichotomous outcome)

Does not work because there are no ‘wholists’

#log_reg_style <- glm(notice ~ style, data = tbl_log_reg, family = binomial)
#summary(log_reg_style)

6.2 Accuracy

tbl_all_cog_style_condensed_acc_wide <- tbl_all_cog_style_condensed_acc_wide[(tbl_all_cog_style_condensed_acc_wide$ID %in% tbl_log_reg_median$ID),]

tbl_log_reg_acc <- merge(tbl_all_cog_style_condensed_acc_wide, tbl_all_notice, by = "ID")
#tbl_log_reg_acc = subset(tbl_log_reg_acc, select = -c(rowNo,type,head,timestamp,RT))
tbl_log_reg_acc[tbl_log_reg_acc == "Yes"] <- 1
tbl_log_reg_acc[tbl_log_reg_acc == "No"] <- 0
tbl_log_reg_acc[tbl_log_reg_acc == "Not sure"] <- 0
names(tbl_log_reg_acc)[names(tbl_log_reg_acc)=="response"] <- "notice"
tbl_log_reg_acc$notice <- as.numeric(tbl_log_reg_acc$notice)
tbl_log_reg_acc$ratio <- tbl_log_reg_acc$matching / tbl_log_reg_acc$embedded

6.2.1 Logistic regression w/ accuracy ratio

log_reg_acc_ratio <- glm(notice ~ ratio, data = tbl_log_reg_acc, family = binomial(link = "logit"))
summary(log_reg_acc_ratio)
## 
## Call:
## glm(formula = notice ~ ratio, family = binomial(link = "logit"), 
##     data = tbl_log_reg_acc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0578  -1.0000  -0.9898   1.3602   1.4023  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept)  -0.6840     1.1191  -0.611    0.541
## ratio         0.2641     1.1552   0.229    0.819
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 170.28  on 126  degrees of freedom
## Residual deviance: 170.22  on 125  degrees of freedom
## AIC: 174.22
## 
## Number of Fisher Scoring iterations: 4
plot_acc_ratio <- ggplot(tbl_log_reg_acc, aes(x=ratio, y=notice)) + geom_point() + stat_smooth(method="glm", method.args=list(family="binomial"), se=TRUE, color="#f7a800") + theme_classic((base_size = 15))
suppressMessages(print(plot_acc_ratio))

6.2.2 Logistic regression w/ embedded accuracy

log_reg_embedded_acc <- glm(notice ~ embedded, data = tbl_log_reg_acc, family = binomial(link = "logit"))
summary(log_reg_embedded_acc)
## 
## Call:
## glm(formula = notice ~ embedded, family = binomial(link = "logit"), 
##     data = tbl_log_reg_acc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5908  -0.9205  -0.8021   1.1694   1.6397  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)    1.812      0.849   2.135  0.03280 * 
## embedded      -2.928      1.087  -2.694  0.00707 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 170.28  on 126  degrees of freedom
## Residual deviance: 162.69  on 125  degrees of freedom
## AIC: 166.69
## 
## Number of Fisher Scoring iterations: 4
plot_embedded_acc <- ggplot(tbl_log_reg_acc, aes(x=embedded, y=notice)) + geom_point() + stat_smooth(method="glm", method.args=list(family="binomial"), se=TRUE, color="#f7a800") + theme_classic((base_size = 15))
suppressMessages(print(plot_embedded_acc))

6.2.3 Logistic regression w/ matching accuracy

log_reg_matching_acc <- glm(notice ~ matching, data = tbl_log_reg_acc, family = binomial(link = "logit"))
summary(log_reg_matching_acc)
## 
## Call:
## glm(formula = notice ~ matching, family = binomial(link = "logit"), 
##     data = tbl_log_reg_acc)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.436  -0.951  -0.747   1.212   1.724  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   2.3156     0.9499   2.438  0.01478 * 
## matching     -3.8328     1.3091  -2.928  0.00341 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 170.28  on 126  degrees of freedom
## Residual deviance: 161.15  on 125  degrees of freedom
## AIC: 165.15
## 
## Number of Fisher Scoring iterations: 4
plot_matching_acc <- ggplot(tbl_log_reg_acc, aes(x=matching, y=notice)) + geom_point() + stat_smooth(method="glm", method.args=list(family="binomial"), se=TRUE, color="#f7a800") + theme_classic((base_size = 15))
suppressMessages(print(plot_matching_acc))

6.2.4 Logistic regression (Dichotomous predictor, dichotomous outcome)

Does not work because there are no ‘wholists’

#log_reg_style <- glm(notice ~ style, data = tbl_log_reg, family = binomial)
#summary(log_reg_style)

6.3 Median RTs and Accuracy

tbl_log_reg_median_acc <- cbind.data.frame(tbl_log_reg_median, tbl_log_reg_acc[c(2,3,5)])
colnames(tbl_log_reg_median_acc) <- c("ID", "embedded_rt", "matching_rt", "ratio_rt", "style", "notice", "embedded_acc", "matching_acc", "ratio_acc")

6.3.1 Logistic regression w/ median RT and accuracy ratios

log_reg_median_acc_ratio <- glm(notice ~ ratio_rt + ratio_acc, data=tbl_log_reg_median_acc, family=binomial)
summary(log_reg_median_acc_ratio)
## 
## Call:
## glm(formula = notice ~ ratio_rt + ratio_acc, family = binomial, 
##     data = tbl_log_reg_median_acc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.7570  -0.7021  -0.6875  -0.6142   1.8658  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.69024    1.36971  -0.504    0.614
## ratio_rt    -0.01135    0.16456  -0.069    0.945
## ratio_acc   -0.62953    1.45300  -0.433    0.665
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 131.41  on 126  degrees of freedom
## Residual deviance: 131.20  on 124  degrees of freedom
## AIC: 137.2
## 
## Number of Fisher Scoring iterations: 4

6.3.2 Logistic regression w/ embedded median rt and accuracy

log_reg_embedded_median_acc <- glm(notice ~ embedded_rt + embedded_acc, data = tbl_log_reg_median_acc, family = binomial(link = "logit"))
summary(log_reg_embedded_median_acc)
## 
## Call:
## glm(formula = notice ~ embedded_rt + embedded_acc, family = binomial(link = "logit"), 
##     data = tbl_log_reg_median_acc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8219  -0.7535  -0.6599  -0.5224   2.0175  
## 
## Coefficients:
##                Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  -2.805e+00  1.174e+00  -2.388   0.0169 *
## embedded_rt   3.172e-05  4.709e-04   0.067   0.9463  
## embedded_acc  1.834e+00  1.465e+00   1.252   0.2107  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 131.41  on 126  degrees of freedom
## Residual deviance: 129.43  on 124  degrees of freedom
## AIC: 135.43
## 
## Number of Fisher Scoring iterations: 4

6.3.3 Logistic regression w/ matching median rt and accuracy

log_reg_matching_median_acc <- glm(notice ~ matching_rt + matching_acc, data = tbl_log_reg_median_acc, family = binomial(link = "logit"))
summary(log_reg_matching_median_acc)
## 
## Call:
## glm(formula = notice ~ matching_rt + matching_acc, family = binomial(link = "logit"), 
##     data = tbl_log_reg_median_acc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8507  -0.7370  -0.6629  -0.5271   1.9444  
## 
## Coefficients:
##                Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  -2.4485022  1.1847999  -2.067   0.0388 *
## matching_rt   0.0001390  0.0002558   0.543   0.5870  
## matching_acc  1.0437242  1.8992114   0.550   0.5826  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 131.41  on 126  degrees of freedom
## Residual deviance: 129.94  on 124  degrees of freedom
## AIC: 135.94
## 
## Number of Fisher Scoring iterations: 4