1 Experiment details

2 Set up R environment

library(tidyverse)
library(ggplot2)
library(ggpubr)
library(plyr)
library(magick)
library(rstatix)
library(reshape2)
library(knitr)
library(lme4)

Set the R working drectory to the main experiment directory.

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

3 Format & manipulate raw data files

3.1 Read-in datafiles

Read in the individual subject files (saved automatically on the server as csv files).

tbl_all <- list.files(path = "./data_v2/", pattern = "*.csv", full.names = T) %>% 
    map_df(~read_csv(.))
tbl_all <- data.frame(tbl_all)

Confirm the number of subjects and make sure the sample sizes reflects the number of data files in the data subdirectory.

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

Define trial conditions by breaking apart the name of the image, given by objs_image column.

tbl_all <- tbl_all %>% 
separate(objs_image,into=c('rectangle_orientation','cue_loc','change_loc','validity','display_num','change_type'))

Rename all the variable values that are now given by the validity variable.

tbl_all <- tbl_all %>% mutate(validity=recode_factor(validity, `V`="valid", `C`="catch", `IS`="invalid_same", `ID`="invalid_different", `objects`="NA"))

Assign the trials to bins based on the trial number.

tbl_all$bin = "filler"
tbl_all[which(tbl_all$trial_number %in% c(1:4)), "bin"] = 0
tbl_all[which(tbl_all$trial_number %in% c(5:27)), "bin"] = 1
tbl_all[which(tbl_all$trial_number %in% c(28:50)), "bin"] = 2
tbl_all[which(tbl_all$trial_number %in% c(51:73)), "bin"] = 3
tbl_all[which(tbl_all$trial_number %in% c(74:96)), "bin"] = 4

tbl_all$bin <- as.numeric(tbl_all$bin)

This chunk will make 2 tables: one contains the number of trials for each individual and the other contains the numer of trials for each individual binned over time. There were 80 target-present trials that were 60% valid (48 trials) and 40% invalid (16 trials for each type). There were also 12 catch trials. The numbers of each trial type were split evenly among the 4 cue locations. The last variable, “sum”, is the total number of trials saved for each participant.

tbl_all_counts <- tbl_all %>%
  group_by(workerId,validity) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different' | validity=='catch') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_all_counts$total_sum = rowSums(tbl_all_counts[,c(-1)], na.rm = TRUE)
kable(tbl_all_counts)
workerId valid catch invalid_same invalid_different total_sum
A101TNXQVR2UPO 48 12 16 16 92
A11Q3D9ADJUKHP 48 12 16 16 92
A11SVF9ZNHO1EW 48 12 16 16 92
A11U9MQRLTBD7S 48 12 16 16 92
A16O7CY4VH5BCP 48 12 16 16 92
A16Z47IWMSXYHP 48 12 16 16 92
A17WT0K0HFTW9U 48 12 16 16 92
A19BZSL0LVFBO2 48 12 16 16 92
A19L8SNH73AX1Z 48 12 16 16 92
A1BKF0KULCF6Y6 48 12 16 16 92
A1BVG13MHBM1YD 48 12 16 16 92
A1FYWSPNO7KN1O 48 12 16 16 92
A1L3937MY09J3I 48 12 16 16 92
A1NN3OSYKM7BLG 48 12 16 16 92
A1PUWQYUQRGCO 48 12 16 16 92
A1SISJL5ST2PWH 48 12 16 16 92
A1TARNH07A75CG 48 12 16 16 92
A1TZARLMBLCJ8X 48 12 16 16 92
A1V2H0UF94ATWY 48 12 16 16 92
A1ZE87WEYCA44A 48 12 16 16 92
A2182DBITJFCMZ 48 12 16 16 92
A21D9YDJU8K2QI 48 12 16 16 92
A21TBK48OBJYSX 48 12 16 16 92
A21UA6O7ZFAIQJ 48 12 16 16 92
A220ZCMBT1YMMU 48 12 16 16 92
A222ICMHU5JXLA 48 12 16 16 92
A22JZM6BEETFWF 48 12 16 16 92
A2482SLAY120J2 48 12 16 16 92
A248QG4DPULP46 48 12 16 16 92
A26Z8M2VSEWUU4 48 12 16 16 92
A29YJJRBSB7D8I 48 12 16 16 92
A2APG8MSLJ6G2K 48 12 16 16 92
A2BFHU3EGQES4W 48 12 16 16 92
A2CHD0TNWHFW1R 48 12 16 16 92
A2FGKKWP33DFWS 48 12 16 16 92
A2GOYSTIL3LOV1 48 12 16 16 92
A2ODH6HV36EP88 48 12 16 16 92
A2OVMMDZQ524IL 48 12 16 16 92
A2PIFMM4Q2I9ZS 46 12 16 16 90
A2PSR3CMNR1R9X 48 12 16 16 92
A2VLTSW6CXIUMR 48 12 16 16 92
A2VNSNAN1LZBAM 48 12 16 16 92
A2WC2NO555XU3J 48 12 16 16 92
A32S6A9SWM5Z67 48 12 16 16 92
A36UNYMDBED99W 48 12 16 16 92
A39GADIK8RLMVC 48 12 16 16 92
A3CASN6JG7104 48 12 16 16 92
A3CL8WUGLQHRP 48 12 16 16 92
A3DWL14MDONAJ 48 12 16 16 92
A3E8NUUS90EWXW 48 12 16 16 92
A3EC3OP6U52JYC 48 12 16 16 92
A3FCZNB9E8K3CX 48 12 16 16 92
A3GK90X2QOFR53 48 12 16 16 92
A3H32595TVJ34Q 48 12 16 16 92
A3K2ZXAFZCHYZI 48 12 16 16 92
A3K9GTQBOI7O5A 48 12 16 16 92
A3KF6O09H04SP7 48 12 16 16 92
A3KQXRF52U36P2 48 12 16 16 92
A3L7IWDL0R3KU9 48 12 16 16 92
A3OZB09ZZLZEFQ 48 12 16 16 92
A3QRZPJT2CT2IK 48 12 16 16 92
A3R818WN41K12K 48 12 16 16 92
A3S4M1GQAMPFZB 48 12 16 16 92
A3S9VNTRSE21UI 48 12 16 16 92
A3SG9Z3TANEGBG 48 12 16 16 92
A3SYY5R44RAATE 48 12 16 16 92
A3UDUHUVFKD833 48 12 16 16 92
A4W9APAHFWVLO 48 12 16 16 92
A6EOG99281TB3 48 12 16 16 92
A6JKKANO7F4KD 48 12 16 16 92
A6X1DYS5VCIL6 48 12 16 16 92
AAAHLPAGDOA2U 48 12 16 16 92
AECA0YXYZ6A0K 48 12 16 16 92
AJODPUVR2P18Q 48 12 16 16 92
AK3H5QRAROFGP 48 12 16 16 92
AKVDY8OXNMQED 48 12 16 16 92
ALBIU0ZCAUNON 48 12 16 16 92
AM8OWAW9TUVLN 48 12 16 16 92
ANUT13S1G9RWU 48 12 16 16 92
AQP4PHYDXRBPI 48 12 16 16 92
ARCCEMO6PIE44 48 12 16 16 92
ARLGZWN6W91WD 48 12 16 16 92
ASB6HK1H1EGA2 48 12 16 16 92
ASI2B6A3Y556Z 48 12 16 16 92
AU5BD5NSSES9H 48 12 16 16 92
AURYD2FH3FUOQ 48 12 16 16 92
AXCIG7A957UO6 48 12 16 16 92
AXKVHJHF1EOVT 48 12 16 16 92
tbl_all_counts_bin <- tbl_all %>%
  group_by(workerId,validity,bin) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different' | validity=='catch') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_all_counts_bin$sum = rowSums(tbl_all_counts_bin[,c(-1:-2)], na.rm = TRUE)
#kable(tbl_all_counts_bin)

This chunk will also make 2 data tables consisting of the counts of main trials, excuding catch trials, as well as binning them over time.

tbl_all_counts_no_catch <- tbl_all %>%
  group_by(workerId,validity) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_all_counts_no_catch$sum = rowSums(tbl_all_counts_no_catch[,c(-1)], na.rm = TRUE)
#kable(tbl_all_counts_no_catch)

tbl_all_counts_no_catch_bin <- tbl_all %>%
  group_by(workerId,validity,bin) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_all_counts_no_catch_bin$sum = rowSums(tbl_all_counts_no_catch_bin[,c(-1:-2)], na.rm = TRUE)
#kable(tbl_all_counts_no_catch_bin)

3.2 Analyze accuracy

The changing object appeared in four possible locations. A sample image is provided below (Note: (1) the thin border around each obect was not visible to participants and is provided for representational purposes, and (2) only one object appeared at a time.). The following X and Y coordinates (in pixels) were obtained from the Octave/PTB script used to generate the stimuli:

UL: xmin = 22, ymin = 22, xmax, 99, ymax, 99

UR: xmin = 424, ymin = 22, xmax = 501, ymax = 99

LL: xmin = 22, ymin = 424, xmax = 99, ymax = 501

LR: xmin = 424, ymin = 424, xmax = 501, ymax = 501

img <- image_read("/Users/adambarnas/Box/MeridianCB/Object_locs.jpg")
img

The coordinates correspond to the upper-left (UL) and lower-right (LR) points of an object [UL X coor (xmin), UL Y coor (ymin), LR X coor (xmax), and LR Y coor (ymax)]. For instance, the object that appeared in the upperleft had coordinates [22, 22, 99, 99]. Note: these ranges correspond to the size of the image file (a 77x77 pixel square).

Trials are labeled 1 if the X and Y coordinate data fell inside the ranges listed above. Trials are labeled 0 if the X and Y coordinate data fell outside these ranges, and are discarded because this indicates that the subject was not accurate (i.e., one or both of their click coordinates was not within the object boundaries).

tbl_all <- tbl_all %>%
  filter(change_loc == "UL" | change_loc == "UR" | change_loc == "LL" | change_loc == "LR")

tbl_all$click_ACC = "filler"

for (i in 1:length(tbl_all$workerId)){
  if (tbl_all$change_loc[i] == "UL"){
    if ((22 <= tbl_all$x[i] & 99 >= tbl_all$x[i]) && (22 <= tbl_all$y[i] & 99 >= tbl_all$y[i])){
      tbl_all$click_ACC[i] = 1
    } else {
      tbl_all$click_ACC[i] = 0
    }
  } else if (tbl_all$change_loc[i] == "UR"){
    if ((424 <= tbl_all$x[i] & 501 >= tbl_all$x[i]) && (22 <= tbl_all$y[i] & 99 >= tbl_all$y[i])){
      tbl_all$click_ACC[i] = 1
    } else {
      tbl_all$click_ACC[i] = 0
    }
  } else if (tbl_all$change_loc[i] == "LL"){
    if ((22 <= tbl_all$x[i] & 99 >= tbl_all$x[i]) && (424 <= tbl_all$y[i] & 501 >= tbl_all$y[i])){
      tbl_all$click_ACC[i] = 1
    } else {
      tbl_all$click_ACC[i] = 0
    }
  } else if (tbl_all$change_loc[i] == "LR"){
    if ((424 <= tbl_all$x[i] & 501 >= tbl_all$x[i]) && (424 <= tbl_all$y[i] & 501 >= tbl_all$y[i])){
      tbl_all$click_ACC[i] = 1
    } else {
      tbl_all$click_ACC[i] = 0
    }
  }
} 

3.2.1 Accuracy on catch trials

Sum the number of good catch trials (1) to get the total number of accurate catch trials per subject.

tbl_good_catch_acc_all_main_acc_counts <- tbl_all %>%
  filter(validity=='catch')
tbl_good_catch_acc_all_main_acc_counts <- tbl_good_catch_acc_all_main_acc_counts %>%
  group_by(workerId,click_ACC) %>%
  dplyr::summarize(counts = n()) %>%
  spread(click_ACC,counts)
tbl_good_catch_acc_all_main_acc_counts$total = rowSums(tbl_good_catch_acc_all_main_acc_counts[,c(-1)], na.rm = TRUE)
tbl_good_catch_acc_all_main_acc_counts[is.na(tbl_good_catch_acc_all_main_acc_counts)] <- 0
colnames(tbl_good_catch_acc_all_main_acc_counts) <- c("workerId", "inacc_catch", "acc_catch", "total_catch")
kable(tbl_good_catch_acc_all_main_acc_counts)
workerId inacc_catch acc_catch total_catch
A101TNXQVR2UPO 9 3 12
A11Q3D9ADJUKHP 8 4 12
A11SVF9ZNHO1EW 3 9 12
A11U9MQRLTBD7S 10 2 12
A16O7CY4VH5BCP 1 11 12
A16Z47IWMSXYHP 0 12 12
A17WT0K0HFTW9U 1 11 12
A19BZSL0LVFBO2 12 0 12
A19L8SNH73AX1Z 2 10 12
A1BKF0KULCF6Y6 5 7 12
A1BVG13MHBM1YD 0 12 12
A1FYWSPNO7KN1O 0 12 12
A1L3937MY09J3I 5 7 12
A1NN3OSYKM7BLG 12 0 12
A1PUWQYUQRGCO 3 9 12
A1SISJL5ST2PWH 0 12 12
A1TARNH07A75CG 4 8 12
A1TZARLMBLCJ8X 1 11 12
A1V2H0UF94ATWY 0 12 12
A1ZE87WEYCA44A 1 11 12
A2182DBITJFCMZ 4 8 12
A21D9YDJU8K2QI 8 4 12
A21TBK48OBJYSX 0 12 12
A21UA6O7ZFAIQJ 0 12 12
A220ZCMBT1YMMU 0 12 12
A222ICMHU5JXLA 11 1 12
A22JZM6BEETFWF 12 0 12
A2482SLAY120J2 1 11 12
A248QG4DPULP46 0 12 12
A26Z8M2VSEWUU4 1 11 12
A29YJJRBSB7D8I 10 2 12
A2APG8MSLJ6G2K 0 12 12
A2BFHU3EGQES4W 12 0 12
A2CHD0TNWHFW1R 1 11 12
A2FGKKWP33DFWS 0 12 12
A2GOYSTIL3LOV1 0 12 12
A2ODH6HV36EP88 0 12 12
A2OVMMDZQ524IL 9 3 12
A2PIFMM4Q2I9ZS 8 4 12
A2PSR3CMNR1R9X 1 11 12
A2VLTSW6CXIUMR 0 12 12
A2VNSNAN1LZBAM 0 12 12
A2WC2NO555XU3J 0 12 12
A32S6A9SWM5Z67 11 1 12
A36UNYMDBED99W 0 12 12
A39GADIK8RLMVC 0 12 12
A3CASN6JG7104 0 12 12
A3CL8WUGLQHRP 12 0 12
A3DWL14MDONAJ 12 0 12
A3E8NUUS90EWXW 3 9 12
A3EC3OP6U52JYC 1 11 12
A3FCZNB9E8K3CX 0 12 12
A3GK90X2QOFR53 0 12 12
A3H32595TVJ34Q 0 12 12
A3K2ZXAFZCHYZI 1 11 12
A3K9GTQBOI7O5A 1 11 12
A3KF6O09H04SP7 1 11 12
A3KQXRF52U36P2 8 4 12
A3L7IWDL0R3KU9 1 11 12
A3OZB09ZZLZEFQ 12 0 12
A3QRZPJT2CT2IK 1 11 12
A3R818WN41K12K 0 12 12
A3S4M1GQAMPFZB 2 10 12
A3S9VNTRSE21UI 12 0 12
A3SG9Z3TANEGBG 11 1 12
A3SYY5R44RAATE 2 10 12
A3UDUHUVFKD833 0 12 12
A4W9APAHFWVLO 0 12 12
A6EOG99281TB3 12 0 12
A6JKKANO7F4KD 0 12 12
A6X1DYS5VCIL6 12 0 12
AAAHLPAGDOA2U 1 11 12
AECA0YXYZ6A0K 7 5 12
AJODPUVR2P18Q 12 0 12
AK3H5QRAROFGP 0 12 12
AKVDY8OXNMQED 0 12 12
ALBIU0ZCAUNON 1 11 12
AM8OWAW9TUVLN 0 12 12
ANUT13S1G9RWU 0 12 12
AQP4PHYDXRBPI 1 11 12
ARCCEMO6PIE44 0 12 12
ARLGZWN6W91WD 0 12 12
ASB6HK1H1EGA2 9 3 12
ASI2B6A3Y556Z 1 11 12
AU5BD5NSSES9H 9 3 12
AURYD2FH3FUOQ 0 12 12
AXCIG7A957UO6 12 0 12
AXKVHJHF1EOVT 0 12 12

Divide the number of accurate catch trials by the number of total catch trials for each participant. The resulting value will be the subjects catch trial rate. Subjects with a catch rate less than .75 will be discarded.

tbl_all_catch_acc_rate <- (tbl_good_catch_acc_all_main_acc_counts$acc_catch / tbl_good_catch_acc_all_main_acc_counts$total_catch)
tbl_all_catch_acc_rate <- cbind.data.frame(tbl_good_catch_acc_all_main_acc_counts[,1], tbl_all_catch_acc_rate)
colnames(tbl_all_catch_acc_rate) <- c("workerId", "catch_rate")
kable(tbl_all_catch_acc_rate)
workerId catch_rate
A101TNXQVR2UPO 0.2500000
A11Q3D9ADJUKHP 0.3333333
A11SVF9ZNHO1EW 0.7500000
A11U9MQRLTBD7S 0.1666667
A16O7CY4VH5BCP 0.9166667
A16Z47IWMSXYHP 1.0000000
A17WT0K0HFTW9U 0.9166667
A19BZSL0LVFBO2 0.0000000
A19L8SNH73AX1Z 0.8333333
A1BKF0KULCF6Y6 0.5833333
A1BVG13MHBM1YD 1.0000000
A1FYWSPNO7KN1O 1.0000000
A1L3937MY09J3I 0.5833333
A1NN3OSYKM7BLG 0.0000000
A1PUWQYUQRGCO 0.7500000
A1SISJL5ST2PWH 1.0000000
A1TARNH07A75CG 0.6666667
A1TZARLMBLCJ8X 0.9166667
A1V2H0UF94ATWY 1.0000000
A1ZE87WEYCA44A 0.9166667
A2182DBITJFCMZ 0.6666667
A21D9YDJU8K2QI 0.3333333
A21TBK48OBJYSX 1.0000000
A21UA6O7ZFAIQJ 1.0000000
A220ZCMBT1YMMU 1.0000000
A222ICMHU5JXLA 0.0833333
A22JZM6BEETFWF 0.0000000
A2482SLAY120J2 0.9166667
A248QG4DPULP46 1.0000000
A26Z8M2VSEWUU4 0.9166667
A29YJJRBSB7D8I 0.1666667
A2APG8MSLJ6G2K 1.0000000
A2BFHU3EGQES4W 0.0000000
A2CHD0TNWHFW1R 0.9166667
A2FGKKWP33DFWS 1.0000000
A2GOYSTIL3LOV1 1.0000000
A2ODH6HV36EP88 1.0000000
A2OVMMDZQ524IL 0.2500000
A2PIFMM4Q2I9ZS 0.3333333
A2PSR3CMNR1R9X 0.9166667
A2VLTSW6CXIUMR 1.0000000
A2VNSNAN1LZBAM 1.0000000
A2WC2NO555XU3J 1.0000000
A32S6A9SWM5Z67 0.0833333
A36UNYMDBED99W 1.0000000
A39GADIK8RLMVC 1.0000000
A3CASN6JG7104 1.0000000
A3CL8WUGLQHRP 0.0000000
A3DWL14MDONAJ 0.0000000
A3E8NUUS90EWXW 0.7500000
A3EC3OP6U52JYC 0.9166667
A3FCZNB9E8K3CX 1.0000000
A3GK90X2QOFR53 1.0000000
A3H32595TVJ34Q 1.0000000
A3K2ZXAFZCHYZI 0.9166667
A3K9GTQBOI7O5A 0.9166667
A3KF6O09H04SP7 0.9166667
A3KQXRF52U36P2 0.3333333
A3L7IWDL0R3KU9 0.9166667
A3OZB09ZZLZEFQ 0.0000000
A3QRZPJT2CT2IK 0.9166667
A3R818WN41K12K 1.0000000
A3S4M1GQAMPFZB 0.8333333
A3S9VNTRSE21UI 0.0000000
A3SG9Z3TANEGBG 0.0833333
A3SYY5R44RAATE 0.8333333
A3UDUHUVFKD833 1.0000000
A4W9APAHFWVLO 1.0000000
A6EOG99281TB3 0.0000000
A6JKKANO7F4KD 1.0000000
A6X1DYS5VCIL6 0.0000000
AAAHLPAGDOA2U 0.9166667
AECA0YXYZ6A0K 0.4166667
AJODPUVR2P18Q 0.0000000
AK3H5QRAROFGP 1.0000000
AKVDY8OXNMQED 1.0000000
ALBIU0ZCAUNON 0.9166667
AM8OWAW9TUVLN 1.0000000
ANUT13S1G9RWU 1.0000000
AQP4PHYDXRBPI 0.9166667
ARCCEMO6PIE44 1.0000000
ARLGZWN6W91WD 1.0000000
ASB6HK1H1EGA2 0.2500000
ASI2B6A3Y556Z 0.9166667
AU5BD5NSSES9H 0.2500000
AURYD2FH3FUOQ 1.0000000
AXCIG7A957UO6 0.0000000
AXKVHJHF1EOVT 1.0000000

3.2.1.1 Group performance

Plot the group’s overall accuracy on the catch trials.

tbl_all_catch_acc_rate %>% 
  ggbarplot(y = "catch_rate", ylab = "Accuracy", fill = "#f7a800", color = "#f7a800", add = "mean_se", ylim = c(0, 1), xlab = "Group", width = 0.5, label = TRUE, lab.nb.digits = 2, lab.vjust = -2.2, title = "Group Catch Trial Performance")

3.2.1.2 Individual performance

Plot individual subject catch trial performance.

tbl_all_catch_acc_rate %>% 
  ggbarplot(x = "workerId", y = "catch_rate", ylab = "Accuracy", fill = "#f7a800", color = "#f7a800", ylim = c(0, 1), title = "Individual Catch Trial Performance", sort.val = c("asc"), font.xtickslab = 6) + rotate_x_text() + geom_hline(yintercept = .75, linetype = 2)

3.2.1.3 Good vs. Bad catch trial performance

This chunk will categorize subjects with “good” or “bad” catch rates and will create two new dataframes: one for good subjects with a catch rate greater than or equal to .75 and one for bad subjects with a catch rate less than .75. This chunk will also plot the catch rates for both groups.

tbl_all_catch_acc_rate$cat = "filler"
for (i in 1:length(tbl_all_catch_acc_rate$workerId)){
  if (tbl_all_catch_acc_rate$catch_rate[i] >= 0.75){
    tbl_all_catch_acc_rate$cat[i] = "Good"
  } else {
    tbl_all_catch_acc_rate$cat[i] = "Bad"
  }
}

tbl_good_catch_acc_rate <- tbl_all_catch_acc_rate %>%
  filter(catch_rate >= 0.75)
tbl_bad_catch_acc_rate <- tbl_all_catch_acc_rate %>%
  filter(catch_rate < 0.75)

tbl_all_catch_acc_rate %>%
  ggbarplot(x = "cat", y = "catch_rate", ylab = "Accuracy", xlab = "Accuracy Group", add = "mean_se", fill = "#f7a800", color = "#f7a800", ylim = c(0, 1), label = TRUE, lab.nb.digits = 2, lab.vjust = c(-2, -1.2), title = "Catch Performance for Bad and Good Subjects", sort.val = c("asc"))

Independent-samples t-test for good and bad subject catch rates.

tbl_all_catch_acc_rate %>%
  group_by(cat) %>%
  get_summary_stats(catch_rate, type = "mean_se")
## # A tibble: 2 x 5
##   cat   variable       n  mean    se
##   <chr> <chr>      <dbl> <dbl> <dbl>
## 1 Bad   catch_rate    30 0.194 0.04 
## 2 Good  catch_rate    58 0.953 0.009
tbl_all_catch_acc_rate %>% 
  with(t.test(catch_rate ~ cat, var.equal = TRUE))
## 
##  Two Sample t-test
## 
## data:  catch_rate by cat
## t = -24.375, df = 86, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.8199736 -0.6963099
## sample estimates:
##  mean in group Bad mean in group Good 
##          0.1944444          0.9525862

3.2.2 Accuracy on main trials

Select the subjects with good catch trial rates from the original tbl_all.

tbl_good_catch_acc_all_main_acc <- tbl_all[(tbl_all$workerId %in% tbl_good_catch_acc_rate$workerId),]

Verify subject count.

nrow(tbl_good_catch_acc_all_main_acc %>% distinct(workerId,.keep_all = FALSE))
## [1] 58

Generate a new table containing the number of trials for each individual after excluding main trials based on accuracy and another table that is binned.

tbl_good_catch_acc_all_main_acc_counts <- tbl_good_catch_acc_all_main_acc %>%
  group_by(workerId,validity) %>%
  filter((validity=='valid' | validity=='invalid_same' | validity=='invalid_different') & click_ACC == 1) %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_good_catch_acc_all_main_acc_counts$sum = rowSums(tbl_good_catch_acc_all_main_acc_counts[,c(-1)], na.rm = TRUE)
kable(tbl_good_catch_acc_all_main_acc_counts)
workerId valid invalid_same invalid_different sum
A11SVF9ZNHO1EW 45 14 16 75
A16O7CY4VH5BCP 45 13 15 73
A16Z47IWMSXYHP 46 16 15 77
A17WT0K0HFTW9U 46 13 15 74
A19L8SNH73AX1Z 45 16 12 73
A1BVG13MHBM1YD 41 15 15 71
A1FYWSPNO7KN1O 48 16 16 80
A1PUWQYUQRGCO 21 7 6 34
A1SISJL5ST2PWH 46 15 16 77
A1TZARLMBLCJ8X 47 16 16 79
A1V2H0UF94ATWY 48 16 15 79
A1ZE87WEYCA44A 42 13 14 69
A21TBK48OBJYSX 48 15 16 79
A21UA6O7ZFAIQJ 47 16 16 79
A220ZCMBT1YMMU 47 15 15 77
A2482SLAY120J2 41 11 14 66
A248QG4DPULP46 47 15 16 78
A26Z8M2VSEWUU4 46 16 15 77
A2APG8MSLJ6G2K 47 14 14 75
A2CHD0TNWHFW1R 15 1 2 18
A2FGKKWP33DFWS 44 13 15 72
A2GOYSTIL3LOV1 48 15 16 79
A2ODH6HV36EP88 46 16 15 77
A2PSR3CMNR1R9X 47 12 14 73
A2VLTSW6CXIUMR 44 14 15 73
A2VNSNAN1LZBAM 47 15 15 77
A2WC2NO555XU3J 46 16 16 78
A36UNYMDBED99W 47 16 16 79
A39GADIK8RLMVC 48 16 16 80
A3CASN6JG7104 14 7 7 28
A3E8NUUS90EWXW 41 5 5 51
A3EC3OP6U52JYC 44 13 12 69
A3FCZNB9E8K3CX 48 14 14 76
A3GK90X2QOFR53 44 12 10 66
A3H32595TVJ34Q 47 15 15 77
A3K2ZXAFZCHYZI 40 9 9 58
A3K9GTQBOI7O5A 48 15 15 78
A3KF6O09H04SP7 47 16 14 77
A3L7IWDL0R3KU9 43 15 13 71
A3QRZPJT2CT2IK 46 15 16 77
A3R818WN41K12K 48 16 15 79
A3S4M1GQAMPFZB 32 7 9 48
A3SYY5R44RAATE 20 8 8 36
A3UDUHUVFKD833 48 15 15 78
A4W9APAHFWVLO 33 14 12 59
A6JKKANO7F4KD 48 16 16 80
AAAHLPAGDOA2U 48 16 16 80
AK3H5QRAROFGP 46 16 14 76
AKVDY8OXNMQED 44 14 16 74
ALBIU0ZCAUNON 47 16 15 78
AM8OWAW9TUVLN 45 15 16 76
ANUT13S1G9RWU 48 16 16 80
AQP4PHYDXRBPI 46 13 13 72
ARCCEMO6PIE44 45 14 15 74
ARLGZWN6W91WD 45 16 15 76
ASI2B6A3Y556Z 47 15 15 77
AURYD2FH3FUOQ 48 16 16 80
AXKVHJHF1EOVT 43 16 13 72
tbl_good_catch_acc_all_main_acc_counts_bin <- tbl_good_catch_acc_all_main_acc %>%
  group_by(workerId,validity,bin) %>%
  filter((validity=='valid' | validity=='invalid_same' | validity=='invalid_different') & click_ACC == 1) %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_good_catch_acc_all_main_acc_counts_bin$sum = rowSums(tbl_good_catch_acc_all_main_acc_counts_bin[,c(-1:-2)], na.rm = TRUE)
#kable(tbl_good_catch_acc_all_main_acc_counts_bin)

Some subjects may have no surviving data for a particular condition. These subjects should be tossed because they have an unequal number of conditions compared to the other subjects.

tbl_good_catch_acc_all_main_acc_NA_conditions_removed <- tbl_good_catch_acc_all_main_acc_counts %>%
  filter(valid!="NA" & invalid_same!="NA" & invalid_different!="NA")

Same table, but binned.

tbl_good_catch_acc_all_main_acc_NA_conditions_removed_bin <- tbl_good_catch_acc_all_main_acc_counts_bin[(tbl_good_catch_acc_all_main_acc_counts_bin$workerId %in% tbl_good_catch_acc_all_main_acc_NA_conditions_removed$workerId),]

Now, let’s get rid of any subjects with NA from tbl_good_catch_acc_all_main_acc and get a count of the number of subjects.

tbl_good_catch_acc_all_main_acc_NA_subjs_removed <- tbl_good_catch_acc_all_main_acc[(tbl_good_catch_acc_all_main_acc$workerId %in% tbl_good_catch_acc_all_main_acc_NA_conditions_removed$workerId),]

nrow(tbl_good_catch_acc_all_main_acc_NA_subjs_removed %>% distinct(workerId,.keep_all = FALSE))
## [1] 58

Get the original number of trials for the relevant subjects.

tbl_good_catch_acc_all_main_acc_counts <- tbl_all_counts_no_catch[(tbl_all_counts_no_catch$workerId %in% tbl_good_catch_acc_all_main_acc_NA_conditions_removed$workerId),]
kable(tbl_good_catch_acc_all_main_acc_counts)
workerId valid invalid_same invalid_different sum
A11SVF9ZNHO1EW 48 16 16 80
A16O7CY4VH5BCP 48 16 16 80
A16Z47IWMSXYHP 48 16 16 80
A17WT0K0HFTW9U 48 16 16 80
A19L8SNH73AX1Z 48 16 16 80
A1BVG13MHBM1YD 48 16 16 80
A1FYWSPNO7KN1O 48 16 16 80
A1PUWQYUQRGCO 48 16 16 80
A1SISJL5ST2PWH 48 16 16 80
A1TZARLMBLCJ8X 48 16 16 80
A1V2H0UF94ATWY 48 16 16 80
A1ZE87WEYCA44A 48 16 16 80
A21TBK48OBJYSX 48 16 16 80
A21UA6O7ZFAIQJ 48 16 16 80
A220ZCMBT1YMMU 48 16 16 80
A2482SLAY120J2 48 16 16 80
A248QG4DPULP46 48 16 16 80
A26Z8M2VSEWUU4 48 16 16 80
A2APG8MSLJ6G2K 48 16 16 80
A2CHD0TNWHFW1R 48 16 16 80
A2FGKKWP33DFWS 48 16 16 80
A2GOYSTIL3LOV1 48 16 16 80
A2ODH6HV36EP88 48 16 16 80
A2PSR3CMNR1R9X 48 16 16 80
A2VLTSW6CXIUMR 48 16 16 80
A2VNSNAN1LZBAM 48 16 16 80
A2WC2NO555XU3J 48 16 16 80
A36UNYMDBED99W 48 16 16 80
A39GADIK8RLMVC 48 16 16 80
A3CASN6JG7104 48 16 16 80
A3E8NUUS90EWXW 48 16 16 80
A3EC3OP6U52JYC 48 16 16 80
A3FCZNB9E8K3CX 48 16 16 80
A3GK90X2QOFR53 48 16 16 80
A3H32595TVJ34Q 48 16 16 80
A3K2ZXAFZCHYZI 48 16 16 80
A3K9GTQBOI7O5A 48 16 16 80
A3KF6O09H04SP7 48 16 16 80
A3L7IWDL0R3KU9 48 16 16 80
A3QRZPJT2CT2IK 48 16 16 80
A3R818WN41K12K 48 16 16 80
A3S4M1GQAMPFZB 48 16 16 80
A3SYY5R44RAATE 48 16 16 80
A3UDUHUVFKD833 48 16 16 80
A4W9APAHFWVLO 48 16 16 80
A6JKKANO7F4KD 48 16 16 80
AAAHLPAGDOA2U 48 16 16 80
AK3H5QRAROFGP 48 16 16 80
AKVDY8OXNMQED 48 16 16 80
ALBIU0ZCAUNON 48 16 16 80
AM8OWAW9TUVLN 48 16 16 80
ANUT13S1G9RWU 48 16 16 80
AQP4PHYDXRBPI 48 16 16 80
ARCCEMO6PIE44 48 16 16 80
ARLGZWN6W91WD 48 16 16 80
ASI2B6A3Y556Z 48 16 16 80
AURYD2FH3FUOQ 48 16 16 80
AXKVHJHF1EOVT 48 16 16 80

3.2.2.1 Group performance

Plot the overall accuracy at the group level.

tbl_overall_good_acc <- (tbl_good_catch_acc_all_main_acc_NA_conditions_removed$sum / tbl_good_catch_acc_all_main_acc_counts$sum)
tbl_overall_good_acc <- cbind.data.frame(tbl_good_catch_acc_all_main_acc_counts[,1], tbl_overall_good_acc)
colnames(tbl_overall_good_acc) <- c("workerId", "main_rate")
kable(tbl_overall_good_acc)
workerId main_rate
A11SVF9ZNHO1EW 0.9375
A16O7CY4VH5BCP 0.9125
A16Z47IWMSXYHP 0.9625
A17WT0K0HFTW9U 0.9250
A19L8SNH73AX1Z 0.9125
A1BVG13MHBM1YD 0.8875
A1FYWSPNO7KN1O 1.0000
A1PUWQYUQRGCO 0.4250
A1SISJL5ST2PWH 0.9625
A1TZARLMBLCJ8X 0.9875
A1V2H0UF94ATWY 0.9875
A1ZE87WEYCA44A 0.8625
A21TBK48OBJYSX 0.9875
A21UA6O7ZFAIQJ 0.9875
A220ZCMBT1YMMU 0.9625
A2482SLAY120J2 0.8250
A248QG4DPULP46 0.9750
A26Z8M2VSEWUU4 0.9625
A2APG8MSLJ6G2K 0.9375
A2CHD0TNWHFW1R 0.2250
A2FGKKWP33DFWS 0.9000
A2GOYSTIL3LOV1 0.9875
A2ODH6HV36EP88 0.9625
A2PSR3CMNR1R9X 0.9125
A2VLTSW6CXIUMR 0.9125
A2VNSNAN1LZBAM 0.9625
A2WC2NO555XU3J 0.9750
A36UNYMDBED99W 0.9875
A39GADIK8RLMVC 1.0000
A3CASN6JG7104 0.3500
A3E8NUUS90EWXW 0.6375
A3EC3OP6U52JYC 0.8625
A3FCZNB9E8K3CX 0.9500
A3GK90X2QOFR53 0.8250
A3H32595TVJ34Q 0.9625
A3K2ZXAFZCHYZI 0.7250
A3K9GTQBOI7O5A 0.9750
A3KF6O09H04SP7 0.9625
A3L7IWDL0R3KU9 0.8875
A3QRZPJT2CT2IK 0.9625
A3R818WN41K12K 0.9875
A3S4M1GQAMPFZB 0.6000
A3SYY5R44RAATE 0.4500
A3UDUHUVFKD833 0.9750
A4W9APAHFWVLO 0.7375
A6JKKANO7F4KD 1.0000
AAAHLPAGDOA2U 1.0000
AK3H5QRAROFGP 0.9500
AKVDY8OXNMQED 0.9250
ALBIU0ZCAUNON 0.9750
AM8OWAW9TUVLN 0.9500
ANUT13S1G9RWU 1.0000
AQP4PHYDXRBPI 0.9000
ARCCEMO6PIE44 0.9250
ARLGZWN6W91WD 0.9500
ASI2B6A3Y556Z 0.9625
AURYD2FH3FUOQ 1.0000
AXKVHJHF1EOVT 0.9000
tbl_overall_good_acc %>% 
  ggbarplot(y = "main_rate", ylab = "Accuracy", fill = "#f7a800", color = "#f7a800", add = "mean_se", ylim = c(0, 1), xlab = "Group", width = 0.5, label = TRUE, lab.nb.digits = 2, lab.vjust = -1.4, title = "Group Main Trial Performance")

3.2.2.2 Accuracy over time

tbl_good_no_NA_bin <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed %>%
  group_by(workerId,validity,bin) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_good_no_NA_bin$sum = rowSums(tbl_good_no_NA_bin[,c(-1:-2)], na.rm = TRUE)
#head(tbl_good_no_NA_bin,10)

tbl_overall_good_acc_bin <- (tbl_good_catch_acc_all_main_acc_NA_conditions_removed_bin$sum / tbl_good_no_NA_bin$sum)
tbl_overall_good_acc_bin <- cbind.data.frame(tbl_good_no_NA_bin[,1:2], tbl_overall_good_acc_bin)
colnames(tbl_overall_good_acc_bin) <- c("workerId", "bin", "ACC")
tbl_overall_good_acc_bin %>% 
  ggline(y = "ACC", x = "bin", ylab = "Accuracy", fill = "#f7a800", color = "#f7a800", add = "mean_se", ylim = c(0, 1), xlab = " Bin", title = "Group Main Trial Performance Over Time", na.rm = TRUE)

Here are repeated measures ANOVA and post-hoc t-tests for the effect of accuracy over time.

tbl_overall_good_acc_bin %>%
  group_by(bin) %>%
  get_summary_stats(ACC, type = "mean_se")
## # A tibble: 4 x 5
##     bin variable     n  mean    se
##   <dbl> <chr>    <dbl> <dbl> <dbl>
## 1     1 ACC         58 0.902 0.018
## 2     2 ACC         58 0.889 0.023
## 3     3 ACC         58 0.886 0.026
## 4     4 ACC         58 0.877 0.028
aov_acc_time <- aov(ACC ~ bin + Error(factor(workerId)/bin), tbl_overall_good_acc_bin)
summary(aov_acc_time)
## 
## Error: factor(workerId)
##           Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 57  6.337  0.1112               
## 
## Error: factor(workerId):bin
##           Df Sum Sq Mean Sq F value Pr(>F)
## bin        1 0.0178 0.01778   1.034  0.313
## Residuals 57 0.9799 0.01719               
## 
## Error: Within
##            Df Sum Sq  Mean Sq F value Pr(>F)
## Residuals 116 0.4365 0.003763
pwc_acc_time <- tbl_overall_good_acc_bin %>%
  pairwise_t_test(
    ACC ~ bin, paired = TRUE,
    p.adjust.method = "bonferroni"
    )
pwc_acc_time
## # A tibble: 6 x 10
##   .y.   group1 group2    n1    n2 statistic    df     p p.adj p.adj.signif
## * <chr> <chr>  <chr>  <int> <int>     <dbl> <dbl> <dbl> <dbl> <chr>       
## 1 ACC   1      2         58    58     0.771    57 0.444     1 ns          
## 2 ACC   1      3         58    58     0.742    57 0.461     1 ns          
## 3 ACC   1      4         58    58     1.05     57 0.296     1 ns          
## 4 ACC   2      3         58    58     0.260    57 0.796     1 ns          
## 5 ACC   2      4         58    58     0.917    57 0.363     1 ns          
## 6 ACC   3      4         58    58     0.870    57 0.388     1 ns

3.2.2.3 Accuracy by validty

tbl_overall_good_acc_cond <- (tbl_good_catch_acc_all_main_acc_NA_conditions_removed[-1] / tbl_good_catch_acc_all_main_acc_counts[-1])
tbl_overall_good_acc_cond <- cbind.data.frame(tbl_good_catch_acc_all_main_acc_counts[,1], tbl_overall_good_acc_cond)
tbl_overall_good_acc_cond <- gather(tbl_overall_good_acc_cond, validity, acc, valid:invalid_different, factor_key=TRUE)
tbl_overall_good_acc_cond %>%   
  ggbarplot(x = "validity", y = "acc", ylab = "Accuracy", fill = "validity" , color = "validity", palette = c("#0d2240", "#00a8e1", "#f7a800", "#E31818", "#dfdddc"), add = "mean_se", ylim = c(0, 1), na.rm = TRUE, label = TRUE, lab.nb.digits = 2, lab.vjust = c(-1.6, -1.6, -1.6), title = "Group Main Trial Performance By Validity", xlab = "Validity")

Here are repeated measures ANOVA and post-hoc t-tests for the effect of accuracy by validty.

tbl_overall_good_acc_cond %>%
  group_by(validity) %>%
  get_summary_stats(acc, type = "mean_se")
## # A tibble: 3 x 5
##   validity          variable     n  mean    se
##   <fct>             <chr>    <dbl> <dbl> <dbl>
## 1 valid             acc         58 0.904 0.021
## 2 invalid_same      acc         58 0.863 0.026
## 3 invalid_different acc         58 0.864 0.025
aov_acc_validity <- aov(acc ~ validity + Error(factor(workerId)/validity), tbl_overall_good_acc_cond)
summary(aov_acc_validity)
## 
## Error: factor(workerId)
##           Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 57  5.304 0.09305               
## 
## Error: factor(workerId):validity
##            Df Sum Sq Mean Sq F value  Pr(>F)   
## validity    2 0.0643 0.03215   6.168 0.00286 **
## Residuals 114 0.5943 0.00521                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pwc_acc_validity <- tbl_overall_good_acc_cond %>%
  pairwise_t_test(
    acc ~ validity, paired = TRUE,
    p.adjust.method = "bonferroni"
    )
pwc_acc_validity
## # A tibble: 3 x 10
##   .y.   group1    group2       n1    n2 statistic    df     p p.adj p.adj.signif
## * <chr> <chr>     <chr>     <int> <int>     <dbl> <dbl> <dbl> <dbl> <chr>       
## 1 acc   valid     invalid_…    58    58    2.76      57 0.008 0.023 *           
## 2 acc   valid     invalid_…    58    58    2.87      57 0.006 0.017 *           
## 3 acc   invalid_… invalid_…    58    58   -0.0987    57 0.922 1     ns

3.2.2.4 Individual performance

Plot the performance for each individual subject.

tbl_overall_good_acc %>% 
  ggbarplot(x = "workerId", y = "main_rate", ylab = "Accuracy", fill = "#f7a800", color = "#f7a800", ylim = c(0, 1), title = "Individual Main Trial Performance", sort.val = c("asc"), font.xtickslab = 8) + rotate_x_text() + geom_hline(yintercept = 0, linetype = 2)

3.3 Remove outlier trials

Inspect data for RT outliers. RTs more than 3 SDs from the subject mean will be removed.

tbl_good_catch_acc_all_main_acc_NA_subjs_removed <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed %>%
  filter(validity!='catch')

This chunk will process RTs by coding them as outliers (again, by more than 3 SDs). Two additional columns are added to the data table. First, an “outliers” column is added that labels an RT as an outlier or not (0 = not an outlier, 1 = an outlier that is great than -3 SDs from the mean, 2 = an outlier that is greater than +3 SDs from the mean). Second, a “removed_RT” column is added that contains non-outlier RTs.

Note: code can be changed to allow for replacement of outliers with the cutoff values.

correct.trials <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed[tbl_good_catch_acc_all_main_acc_NA_subjs_removed$click_ACC == 1,]

tbl_good_catch_acc_all_main_acc_NA_subjs_removed <- ddply(correct.trials, .(workerId), function(x){
  m <- mean(x$rt)
  s <- sd(x$rt)
  upper <- m + 3*s #change to increase or decrease cutoff criteria
  lower <- m - 3*s #change to increase or decrease cutoff criteria
  
  x$outliers <- 0
  x$outliers[x$rt > upper] <- 2
  x$outliers[x$rt < lower] <- 1
  x$removed_RT <- x$rt
  x$removed_RT[x$rt > upper]<- NA #replace with upper to replace an outlier with the upper cutoff
  x$removed_RT[x$rt < lower]<- NA #replace with lower to replace an outlier with the lower cutoff
  
  x
})

Get trial counts.

tbl_good_catch_acc_all_main_acc_counts <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed %>%
  group_by(workerId,validity) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_good_catch_acc_all_main_acc_counts$sum = rowSums(tbl_good_catch_acc_all_main_acc_counts[,c(-1)], na.rm = TRUE)

Remove outliers.

tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed[!is.na(tbl_good_catch_acc_all_main_acc_NA_subjs_removed$removed_RT),]

Make a table containing the number of trials for each individual after excluding trials based on accuracy AND outliers.

tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_counts <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed %>%
  group_by(workerId,validity) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different') %>%
  dplyr::summarize(counts = n()) %>%
  spread(validity,counts)
tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_counts$sum = rowSums(tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_counts[,c(-1)], na.rm = TRUE)
kable(tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_counts)
workerId valid invalid_same invalid_different sum
A11SVF9ZNHO1EW 44 14 16 74
A16O7CY4VH5BCP 44 12 15 71
A16Z47IWMSXYHP 45 16 14 75
A17WT0K0HFTW9U 45 13 15 73
A19L8SNH73AX1Z 44 16 12 72
A1BVG13MHBM1YD 41 14 14 69
A1FYWSPNO7KN1O 48 15 15 78
A1PUWQYUQRGCO 20 7 6 33
A1SISJL5ST2PWH 46 15 15 76
A1TZARLMBLCJ8X 47 16 15 78
A1V2H0UF94ATWY 48 16 14 78
A1ZE87WEYCA44A 41 12 14 67
A21TBK48OBJYSX 47 15 16 78
A21UA6O7ZFAIQJ 47 16 16 79
A220ZCMBT1YMMU 45 15 15 75
A2482SLAY120J2 41 11 14 66
A248QG4DPULP46 47 15 16 78
A26Z8M2VSEWUU4 45 16 15 76
A2APG8MSLJ6G2K 47 13 14 74
A2CHD0TNWHFW1R 14 1 2 17
A2FGKKWP33DFWS 44 13 13 70
A2GOYSTIL3LOV1 48 14 16 78
A2ODH6HV36EP88 45 16 15 76
A2PSR3CMNR1R9X 46 12 14 72
A2VLTSW6CXIUMR 44 14 15 73
A2VNSNAN1LZBAM 46 13 15 74
A2WC2NO555XU3J 44 16 16 76
A36UNYMDBED99W 46 15 16 77
A39GADIK8RLMVC 48 15 16 79
A3CASN6JG7104 14 6 7 27
A3E8NUUS90EWXW 40 5 4 49
A3EC3OP6U52JYC 44 13 11 68
A3FCZNB9E8K3CX 47 13 14 74
A3GK90X2QOFR53 44 12 9 65
A3H32595TVJ34Q 46 14 15 75
A3K2ZXAFZCHYZI 39 8 9 56
A3K9GTQBOI7O5A 48 15 14 77
A3KF6O09H04SP7 47 15 14 76
A3L7IWDL0R3KU9 43 15 13 71
A3QRZPJT2CT2IK 46 15 15 76
A3R818WN41K12K 48 15 15 78
A3S4M1GQAMPFZB 31 7 8 46
A3SYY5R44RAATE 20 8 8 36
A3UDUHUVFKD833 47 15 15 77
A4W9APAHFWVLO 32 14 12 58
A6JKKANO7F4KD 48 15 16 79
AAAHLPAGDOA2U 47 16 16 79
AK3H5QRAROFGP 45 16 14 75
AKVDY8OXNMQED 44 14 16 74
ALBIU0ZCAUNON 47 16 14 77
AM8OWAW9TUVLN 45 14 16 75
ANUT13S1G9RWU 48 16 15 79
AQP4PHYDXRBPI 44 13 13 70
ARCCEMO6PIE44 43 14 15 72
ARLGZWN6W91WD 45 15 15 75
ASI2B6A3Y556Z 47 14 15 76
AURYD2FH3FUOQ 47 15 16 78
AXKVHJHF1EOVT 42 15 12 69

What was the percentage of outlier RTs that were removed?

tbl_rts_removed_count <- tbl_good_catch_acc_all_main_acc_counts[-1] - tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_counts[-1]
per_RTs_removed <- (sum(tbl_rts_removed_count$sum) / sum(tbl_good_catch_acc_all_main_acc_counts$sum)) * 100
per_RTs_removed
## [1] 1.747149

4 Analyze data

4.1 Summary statistics

Confirm subject count.

nrow(data.frame(tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed %>% distinct(workerId,.keep_all = FALSE)))
## [1] 58

Get RTs to look for space-based and object-based change blindness effects.

tbl_final <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed %>%
  group_by(workerId,validity) %>%
  filter(validity=='valid' | validity=='invalid_same' | validity=='invalid_different') %>%
  dplyr::summarize(mean_rt = mean(removed_RT, na.rm=TRUE))
kable(tbl_final)
workerId validity mean_rt
A11SVF9ZNHO1EW valid 4730.545
A11SVF9ZNHO1EW invalid_same 5621.214
A11SVF9ZNHO1EW invalid_different 5870.750
A16O7CY4VH5BCP valid 5767.545
A16O7CY4VH5BCP invalid_same 6120.417
A16O7CY4VH5BCP invalid_different 5934.600
A16Z47IWMSXYHP valid 8329.867
A16Z47IWMSXYHP invalid_same 10943.062
A16Z47IWMSXYHP invalid_different 7242.643
A17WT0K0HFTW9U valid 4862.267
A17WT0K0HFTW9U invalid_same 6137.846
A17WT0K0HFTW9U invalid_different 6429.400
A19L8SNH73AX1Z valid 5782.500
A19L8SNH73AX1Z invalid_same 5710.500
A19L8SNH73AX1Z invalid_different 6757.000
A1BVG13MHBM1YD valid 5379.146
A1BVG13MHBM1YD invalid_same 4863.714
A1BVG13MHBM1YD invalid_different 4781.143
A1FYWSPNO7KN1O valid 4735.062
A1FYWSPNO7KN1O invalid_same 5068.600
A1FYWSPNO7KN1O invalid_different 4885.600
A1PUWQYUQRGCO valid 8558.550
A1PUWQYUQRGCO invalid_same 8422.571
A1PUWQYUQRGCO invalid_different 8041.667
A1SISJL5ST2PWH valid 4116.935
A1SISJL5ST2PWH invalid_same 4161.133
A1SISJL5ST2PWH invalid_different 4124.200
A1TZARLMBLCJ8X valid 5186.234
A1TZARLMBLCJ8X invalid_same 5771.625
A1TZARLMBLCJ8X invalid_different 5870.200
A1V2H0UF94ATWY valid 4744.312
A1V2H0UF94ATWY invalid_same 6172.375
A1V2H0UF94ATWY invalid_different 6925.929
A1ZE87WEYCA44A valid 4833.195
A1ZE87WEYCA44A invalid_same 5777.917
A1ZE87WEYCA44A invalid_different 5301.786
A21TBK48OBJYSX valid 5052.085
A21TBK48OBJYSX invalid_same 6296.467
A21TBK48OBJYSX invalid_different 6090.375
A21UA6O7ZFAIQJ valid 4782.447
A21UA6O7ZFAIQJ invalid_same 5081.062
A21UA6O7ZFAIQJ invalid_different 5146.062
A220ZCMBT1YMMU valid 7288.889
A220ZCMBT1YMMU invalid_same 7153.267
A220ZCMBT1YMMU invalid_different 7975.400
A2482SLAY120J2 valid 4829.341
A2482SLAY120J2 invalid_same 4886.636
A2482SLAY120J2 invalid_different 5146.643
A248QG4DPULP46 valid 4366.106
A248QG4DPULP46 invalid_same 5210.467
A248QG4DPULP46 invalid_different 5661.938
A26Z8M2VSEWUU4 valid 4625.267
A26Z8M2VSEWUU4 invalid_same 4845.438
A26Z8M2VSEWUU4 invalid_different 4769.200
A2APG8MSLJ6G2K valid 4543.170
A2APG8MSLJ6G2K invalid_same 4992.231
A2APG8MSLJ6G2K invalid_different 5535.500
A2CHD0TNWHFW1R valid 4167.786
A2CHD0TNWHFW1R invalid_same 5305.000
A2CHD0TNWHFW1R invalid_different 5401.500
A2FGKKWP33DFWS valid 6499.295
A2FGKKWP33DFWS invalid_same 6278.769
A2FGKKWP33DFWS invalid_different 6564.692
A2GOYSTIL3LOV1 valid 4408.271
A2GOYSTIL3LOV1 invalid_same 4678.143
A2GOYSTIL3LOV1 invalid_different 4859.938
A2ODH6HV36EP88 valid 4685.444
A2ODH6HV36EP88 invalid_same 4799.750
A2ODH6HV36EP88 invalid_different 4802.000
A2PSR3CMNR1R9X valid 4245.391
A2PSR3CMNR1R9X invalid_same 5139.250
A2PSR3CMNR1R9X invalid_different 4883.857
A2VLTSW6CXIUMR valid 5063.750
A2VLTSW6CXIUMR invalid_same 6015.500
A2VLTSW6CXIUMR invalid_different 5826.800
A2VNSNAN1LZBAM valid 5402.739
A2VNSNAN1LZBAM invalid_same 5536.077
A2VNSNAN1LZBAM invalid_different 5520.267
A2WC2NO555XU3J valid 4488.182
A2WC2NO555XU3J invalid_same 5198.188
A2WC2NO555XU3J invalid_different 5120.812
A36UNYMDBED99W valid 4396.565
A36UNYMDBED99W invalid_same 5748.400
A36UNYMDBED99W invalid_different 5847.688
A39GADIK8RLMVC valid 4491.625
A39GADIK8RLMVC invalid_same 5175.067
A39GADIK8RLMVC invalid_different 5152.438
A3CASN6JG7104 valid 10258.286
A3CASN6JG7104 invalid_same 9596.333
A3CASN6JG7104 invalid_different 9450.714
A3E8NUUS90EWXW valid 7079.075
A3E8NUUS90EWXW invalid_same 8657.800
A3E8NUUS90EWXW invalid_different 8386.750
A3EC3OP6U52JYC valid 4435.227
A3EC3OP6U52JYC invalid_same 4725.231
A3EC3OP6U52JYC invalid_different 4675.545
A3FCZNB9E8K3CX valid 4442.085
A3FCZNB9E8K3CX invalid_same 4940.308
A3FCZNB9E8K3CX invalid_different 4695.357
A3GK90X2QOFR53 valid 4352.977
A3GK90X2QOFR53 invalid_same 4628.750
A3GK90X2QOFR53 invalid_different 4648.889
A3H32595TVJ34Q valid 5274.848
A3H32595TVJ34Q invalid_same 5212.571
A3H32595TVJ34Q invalid_different 5394.333
A3K2ZXAFZCHYZI valid 4150.179
A3K2ZXAFZCHYZI invalid_same 4955.500
A3K2ZXAFZCHYZI invalid_different 4826.333
A3K9GTQBOI7O5A valid 5038.438
A3K9GTQBOI7O5A invalid_same 5616.000
A3K9GTQBOI7O5A invalid_different 4985.571
A3KF6O09H04SP7 valid 4575.468
A3KF6O09H04SP7 invalid_same 4657.933
A3KF6O09H04SP7 invalid_different 4668.143
A3L7IWDL0R3KU9 valid 5090.116
A3L7IWDL0R3KU9 invalid_same 5416.867
A3L7IWDL0R3KU9 invalid_different 5387.923
A3QRZPJT2CT2IK valid 5161.457
A3QRZPJT2CT2IK invalid_same 5624.067
A3QRZPJT2CT2IK invalid_different 6084.000
A3R818WN41K12K valid 6562.646
A3R818WN41K12K invalid_same 6739.400
A3R818WN41K12K invalid_different 6755.867
A3S4M1GQAMPFZB valid 6808.000
A3S4M1GQAMPFZB invalid_same 6932.000
A3S4M1GQAMPFZB invalid_different 7001.875
A3SYY5R44RAATE valid 7047.900
A3SYY5R44RAATE invalid_same 7313.125
A3SYY5R44RAATE invalid_different 7760.250
A3UDUHUVFKD833 valid 4668.064
A3UDUHUVFKD833 invalid_same 5348.133
A3UDUHUVFKD833 invalid_different 5642.000
A4W9APAHFWVLO valid 4307.812
A4W9APAHFWVLO invalid_same 4684.357
A4W9APAHFWVLO invalid_different 5023.000
A6JKKANO7F4KD valid 4912.938
A6JKKANO7F4KD invalid_same 5637.267
A6JKKANO7F4KD invalid_different 5926.625
AAAHLPAGDOA2U valid 5179.979
AAAHLPAGDOA2U invalid_same 5135.625
AAAHLPAGDOA2U invalid_different 5301.312
AK3H5QRAROFGP valid 4344.044
AK3H5QRAROFGP invalid_same 5375.188
AK3H5QRAROFGP invalid_different 6295.714
AKVDY8OXNMQED valid 6038.841
AKVDY8OXNMQED invalid_same 5443.000
AKVDY8OXNMQED invalid_different 6001.125
ALBIU0ZCAUNON valid 4663.511
ALBIU0ZCAUNON invalid_same 5568.250
ALBIU0ZCAUNON invalid_different 5800.786
AM8OWAW9TUVLN valid 4649.622
AM8OWAW9TUVLN invalid_same 5092.643
AM8OWAW9TUVLN invalid_different 5056.312
ANUT13S1G9RWU valid 4942.354
ANUT13S1G9RWU invalid_same 5168.250
ANUT13S1G9RWU invalid_different 5196.200
AQP4PHYDXRBPI valid 5383.455
AQP4PHYDXRBPI invalid_same 5911.846
AQP4PHYDXRBPI invalid_different 5777.538
ARCCEMO6PIE44 valid 4227.093
ARCCEMO6PIE44 invalid_same 4374.071
ARCCEMO6PIE44 invalid_different 4243.333
ARLGZWN6W91WD valid 4696.844
ARLGZWN6W91WD invalid_same 5596.667
ARLGZWN6W91WD invalid_different 5040.067
ASI2B6A3Y556Z valid 4579.319
ASI2B6A3Y556Z invalid_same 5898.429
ASI2B6A3Y556Z invalid_different 5891.533
AURYD2FH3FUOQ valid 5305.170
AURYD2FH3FUOQ invalid_same 5942.867
AURYD2FH3FUOQ invalid_different 6151.812
AXKVHJHF1EOVT valid 5674.071
AXKVHJHF1EOVT invalid_same 5488.733
AXKVHJHF1EOVT invalid_different 5383.583
tbl_final %>%
  group_by(validity) %>%
  get_summary_stats(mean_rt, type = "mean_se")
## # A tibble: 3 x 5
##   validity          variable     n  mean    se
##   <fct>             <chr>    <dbl> <dbl> <dbl>
## 1 valid             mean_rt     58 5245.  157.
## 2 invalid_same      mean_rt     58 5738.  161.
## 3 invalid_different mean_rt     58 5757.  140.

4.2 Plot

tbl_final %>% 
  ggbarplot(x = "validity", y = "mean_rt", ylab = "Mean raw RT (ms)", fill = "validity" , color = "validity", palette = c("#0d2240", "#00a8e1", "#f7a800"), add = "mean_se", ylim = c(0, 8000))

4.3 ANOVA and t-tests

Repeated measures ANOVA

aov_rt_validity <- aov(mean_rt ~ validity + Error(factor(workerId)/validity), tbl_final)
summary(aov_rt_validity)
## 
## Error: factor(workerId)
##           Df    Sum Sq Mean Sq F value Pr(>F)
## Residuals 57 210813157 3698476               
## 
## Error: factor(workerId):validity
##            Df   Sum Sq Mean Sq F value   Pr(>F)    
## validity    2  9774511 4887255   27.05 2.44e-10 ***
## Residuals 114 20599238  180695                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparison. First, space-based attentional selection; Second, object-based attentional selection is second.

tbl_final %>% 
  filter(validity == "valid" | validity == "invalid_same") %>%
  with(t.test(mean_rt~validity,paired=TRUE))
## 
##  Paired t-test
## 
## data:  mean_rt by validity
## t = -6.4633, df = 57, p-value = 2.481e-08
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -645.4167 -340.0854
## sample estimates:
## mean of the differences 
##               -492.7511
tbl_final %>% 
  filter(validity == "invalid_different" | validity == "invalid_same") %>%
  with(t.test(mean_rt~validity,paired=TRUE))
## 
##  Paired t-test
## 
## data:  mean_rt by validity
## t = -0.24801, df = 57, p-value = 0.805
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -176.8892  137.9021
## sample estimates:
## mean of the differences 
##               -19.49352

4.4 Linear modeling

Two chunks will perform linear modeling on RT data as a function of validity. The two chunks differ based on what is the reference group. In the first model, “valid” is the reference group and is contrasted with invalid-same (space-based effect) and invalid different. In the second model, “invalid-same” is the reference group and is contrasted with valid (space-based effect) and invalid-different (object-based effect). Moving forward, subsequent linear models will be strucuted like Model #2 (invalid-same as reference group)

4.4.1 Reference: valid

model_Vref = lmer(removed_RT ~ validity + (1 | workerId), data = tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed)
summary(model_Vref)
## Linear mixed model fit by REML ['lmerMod']
## Formula: removed_RT ~ validity + (1 | workerId)
##    Data: tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed
## 
## REML criterion at convergence: 69115.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.8033 -0.4485 -0.1400  0.2900 13.8643 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  workerId (Intercept) 1219468  1104    
##  Residual             1442660  1201    
## Number of obs: 4049, groups:  workerId, 58
## 
## Fixed effects:
##                           Estimate Std. Error t value
## (Intercept)                5230.44     147.08   35.56
## validityinvalid_same        500.68      49.41   10.13
## validityinvalid_different   526.65      49.26   10.69
## 
## Correlation of Fixed Effects:
##             (Intr) vldtynvld_s
## vldtynvld_s -0.080            
## vldtynvld_d -0.080  0.241

4.4.2 Reference: invalid-same

model_ISref = lmer(removed_RT ~ relevel(validity, ref = "invalid_same") + (1 | workerId), data = tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed)
summary(model_ISref)
## Linear mixed model fit by REML ['lmerMod']
## Formula: removed_RT ~ relevel(validity, ref = "invalid_same") + (1 | workerId)
##    Data: tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed
## 
## REML criterion at convergence: 69115.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.8033 -0.4485 -0.1400  0.2900 13.8643 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  workerId (Intercept) 1219468  1104    
##  Residual             1442660  1201    
## Number of obs: 4049, groups:  workerId, 58
## 
## Fixed effects:
##                                                          Estimate Std. Error
## (Intercept)                                               5731.13     151.39
## relevel(validity, ref = "invalid_same")valid              -500.68      49.41
## relevel(validity, ref = "invalid_same")invalid_different    25.96      60.78
##                                                          t value
## (Intercept)                                               37.857
## relevel(validity, ref = "invalid_same")valid             -10.133
## relevel(validity, ref = "invalid_same")invalid_different   0.427
## 
## Correlation of Fixed Effects:
##             (Intr) rl(,r="_")
## rlv(,r="_") -0.249           
## rl(,r="_")_ -0.202  0.617

4.5 Individual effects

This chunk will generate separate plots for individual space-based and object-based effects.

effects <- spread(tbl_final, validity, mean_rt)
effects$space_effect <- (effects$invalid_same - effects$valid)
effects$object_effect <- (effects$invalid_different - effects$invalid_same)

effects <- effects %>%
  arrange(space_effect)

effects$space_order <- as.character(effects$workerId)

effects %>%
  ggbarplot(x = "workerId", y = "space_effect", ylab = "Space-based effect (ms)", fill = "#f7a800" , add = "none", sort.val = c("asc"), font.ytickslab = 4, orientation = "horiz") + geom_hline(yintercept = 0, linetype = 1, color = "red", size=1) 

effects %>%
  ggbarplot(x = "workerId", y = "object_effect", ylab = "Object-based effect (ms)", fill = "#f7a800" , add = "none", sort.val = c("asc"), font.ytickslab = 4, orientation = "horiz") + geom_hline(yintercept = 0, linetype = 1, color = "red", size=1) 

After looking at the these plots, the effects of one subject are visibly different than the others. The next bit of code will remove him and the same analyses will be performed on the remaining subjects.

4.6 Analyses without outlier subject

Toss out the subject.

tbl_final_subj_removed <- tbl_final %>% 
  filter(workerId != "A16Z47IWMSXYHP")
tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_subj_removed <- tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed %>%
  filter(workerId != "A16Z47IWMSXYHP")

4.6.1 Summary statistics

Confirm subject count.

nrow(data.frame(tbl_final_subj_removed %>% distinct(workerId,.keep_all = FALSE)))
## [1] 57

Get RTs to look for space-based and object-based change blindness effects.

tbl_final_subj_removed %>%
  group_by(validity) %>%
  get_summary_stats(mean_rt, type = "mean_se")
## # A tibble: 3 x 5
##   validity          variable     n  mean    se
##   <fct>             <chr>    <dbl> <dbl> <dbl>
## 1 valid             mean_rt     57 5191.  150.
## 2 invalid_same      mean_rt     57 5646.  134.
## 3 invalid_different mean_rt     57 5731.  140.

4.6.2 Plot

tbl_final_subj_removed %>% 
  ggbarplot(x = "validity", y = "mean_rt", ylab = "Mean raw RT (ms)", fill = "validity" , color = "validity", palette = c("#0d2240", "#00a8e1", "#f7a800"), add = "mean_se", ylim = c(0, 8000))

4.6.3 ANOVA and t-tests

Repeated measures ANOVA

aov_rt_validity_subj_removed <- aov(mean_rt ~ validity + Error(factor(workerId)/validity), tbl_final_subj_removed)
summary(aov_rt_validity_subj_removed)
## 
## Error: factor(workerId)
##           Df    Sum Sq Mean Sq F value Pr(>F)
## Residuals 56 178401151 3185735               
## 
## Error: factor(workerId):validity
##            Df   Sum Sq Mean Sq F value   Pr(>F)    
## validity    2  9626150 4813075   39.89 8.29e-14 ***
## Residuals 112 13512947  120651                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparison. First, space-based attentional selection; Second, object-based attentional selection is second.

tbl_final_subj_removed %>% 
  filter(validity == "valid" | validity == "invalid_same") %>%
  with(t.test(mean_rt~validity,paired=TRUE))
## 
##  Paired t-test
## 
## data:  mean_rt by validity
## t = -6.7265, df = 56, p-value = 9.787e-09
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -591.2189 -319.8816
## sample estimates:
## mean of the differences 
##               -455.5503
tbl_final_subj_removed %>% 
  filter(validity == "invalid_different" | validity == "invalid_same") %>%
  with(t.test(mean_rt~validity,paired=TRUE))
## 
##  Paired t-test
## 
## data:  mean_rt by validity
## t = -1.9011, df = 56, p-value = 0.06244
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -174.063776    4.553476
## sample estimates:
## mean of the differences 
##               -84.75515

4.6.4 Linear modeling

Two chunks will perform linear modeling on RT data as a function of validity. The two chunks differ based on what is the reference group. In the first model, “valid” is the reference group and is contrasted with invalid-same (space-based effect) and invalid different. In the second model, “invalid-same” is the reference group and is contrasted with valid (space-based effect) and invalid-different (object-based effect). Moving forward, subsequent linear models will be strucuted like Model #2 (invalid-same as reference group)

4.6.4.1 Reference: valid

model_Vref_subj_removed = lmer(removed_RT ~ validity + (1 | workerId), data = tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_subj_removed)
summary(model_Vref_subj_removed)
## Linear mixed model fit by REML ['lmerMod']
## Formula: removed_RT ~ validity + (1 | workerId)
##    Data: 
## tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_subj_removed
## 
## REML criterion at convergence: 66789.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.5031 -0.5016 -0.1509  0.3204 15.6511 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  workerId (Intercept) 1056656  1028    
##  Residual             1106945  1052    
## Number of obs: 3974, groups:  workerId, 57
## 
## Fixed effects:
##                           Estimate Std. Error t value
## (Intercept)                5176.43     137.89   37.54
## validityinvalid_same        456.50      43.72   10.44
## validityinvalid_different   555.89      43.55   12.77
## 
## Correlation of Fixed Effects:
##             (Intr) vldtynvld_s
## vldtynvld_s -0.075            
## vldtynvld_d -0.075  0.241

4.6.4.2 Reference: invalid-same

model_ISref_subj_removed = lmer(removed_RT ~ relevel(validity, ref = "invalid_same") + (1 | workerId), data = tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_subj_removed)
summary(model_ISref_subj_removed)
## Linear mixed model fit by REML ['lmerMod']
## Formula: removed_RT ~ relevel(validity, ref = "invalid_same") + (1 | workerId)
##    Data: 
## tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_subj_removed
## 
## REML criterion at convergence: 66789.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.5031 -0.5016 -0.1509  0.3204 15.6511 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  workerId (Intercept) 1056656  1028    
##  Residual             1106945  1052    
## Number of obs: 3974, groups:  workerId, 57
## 
## Fixed effects:
##                                                          Estimate Std. Error
## (Intercept)                                               5632.93     141.50
## relevel(validity, ref = "invalid_same")valid              -456.50      43.72
## relevel(validity, ref = "invalid_same")invalid_different    99.39      53.76
##                                                          t value
## (Intercept)                                               39.810
## relevel(validity, ref = "invalid_same")valid             -10.442
## relevel(validity, ref = "invalid_same")invalid_different   1.849
## 
## Correlation of Fixed Effects:
##             (Intr) rl(,r="_")
## rlv(,r="_") -0.236           
## rl(,r="_")_ -0.191  0.618

5 Save dataframe for individual subject analyses

write.csv(tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed,'tbl_for_bootstrap_raw_rts.csv', row.names=FALSE)
write.csv(tbl_good_catch_acc_all_main_acc_NA_subjs_removed_3_SDs_removed_subj_removed,'tbl_for_bootstrap_raw_rts_subj_removed.csv', row.names=FALSE)