## ── Attaching packages ────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.1.0 ✔ purrr 0.2.5
## ✔ tibble 1.4.2 ✔ dplyr 0.7.8
## ✔ tidyr 0.8.2 ✔ stringr 1.3.1
## ✔ readr 1.1.1 ✔ forcats 0.3.0
## ── Conflicts ───────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## Loading required package: coda
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
## The following object is masked from 'package:tidyr':
##
## expand
## ************
## Welcome to BayesFactor 0.9.12-4.2. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
##
## Type BFManual() to open the manual.
## ************
##
## Attaching package: 'nlme'
## The following object is masked from 'package:dplyr':
##
## collapse
## here() starts at /Volumes/psychology$/Researchers/reteig/MFBrain
## R version 3.5.1 (2018-07-02)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: OS X El Capitan 10.11.6
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] here_0.1 apa_0.3.0 knitr_1.21
## [4] broom_0.5.1 nlme_3.1-137 BayesFactor_0.9.12-4.2
## [7] Matrix_1.2-14 coda_0.19-2 ez_4.4-0
## [10] forcats_0.3.0 stringr_1.3.1 dplyr_0.7.8
## [13] purrr_0.2.5 readr_1.1.1 tidyr_0.8.2
## [16] tibble_1.4.2 ggplot2_3.1.0 tidyverse_1.2.1
##
## loaded via a namespace (and not attached):
## [1] httr_1.3.1 jsonlite_1.6 splines_3.5.1
## [4] carData_3.0-2 modelr_0.1.2 gtools_3.8.1
## [7] assertthat_0.2.0 cellranger_1.1.0 yaml_2.2.0
## [10] pillar_1.3.1 backports_1.1.3 lattice_0.20-35
## [13] glue_1.3.0 digest_0.6.18 rvest_0.3.2
## [16] minqa_1.2.4 colorspace_1.3-2 htmltools_0.3.6
## [19] plyr_1.8.4 pkgconfig_2.0.2 haven_1.1.2
## [22] mvtnorm_1.0-8 scales_1.0.0 openxlsx_4.1.0
## [25] rio_0.5.10 lme4_1.1-19 MatrixModels_0.4-1
## [28] mgcv_1.8-24 generics_0.0.2 car_3.0-2
## [31] withr_2.1.2 pbapply_1.3-4 lazyeval_0.2.1
## [34] cli_1.0.1 magrittr_1.5 crayon_1.3.4
## [37] readxl_1.1.0 evaluate_0.12 MASS_7.3-50
## [40] xml2_1.2.0 foreign_0.8-70 tools_3.5.1
## [43] data.table_1.11.8 hms_0.4.2 munsell_0.5.0
## [46] zip_1.0.0 bindrcpp_0.2.2 compiler_3.5.1
## [49] rlang_0.3.0.1 grid_3.5.1 nloptr_1.2.1
## [52] rstudioapi_0.8 rmarkdown_1.11 gtable_0.2.0
## [55] abind_1.4-5 curl_3.2 reshape2_1.4.3
## [58] R6_2.3.0 lubridate_1.7.4 rprojroot_1.3-2
## [61] bindr_0.1.1 stringi_1.2.4 parallel_3.5.1
## [64] Rcpp_1.0.0 tidyselect_0.2.5 xfun_0.4
ezANOVA_pes <- function(ez_output) { # add partial eta-squared to output from ezANOVA
ez_output$ANOVA$pes <- ez_output$ANOVA$SSn/(ez_output$ANOVA$SSn + ez_output$ANOVA$SSd)
return(ez_output)
}
cohen_d_paired <- function(t_test_output) { # add cohen's d to output from paired t-tests
t_test_output$d <- abs(t_test_output$statistic) / sqrt(t_test_output$parameter + 1)
return(t_test_output)
}
# do frequentist and bayesian paired t-tests; print output as table
paired_test_eeg <- function(df, return_t = FALSE, return_BF = FALSE) {
df %<>%
filter(time %in% c("60","70")) %>% # keep only data for t-test
group_by(region) %>% # for each hemisphere
spread(time,voltage) %>%
nest() %>% # create a separate data frame of all remaining columns. These data frames are stored in a list-column named "data"
mutate(stats = map(data, ~t.test(.$`60`, .$`70`, paired = TRUE)),
BF = map_dbl(data, ~extractBF(ttestBF(.$`60`, .$`70`, paired = TRUE), onlybf = TRUE)))
return(df)
}
print_paired_test_eeg <- function(df, return_t = FALSE, return_BF = FALSE) {
if (return_t) {
df %<>%
mutate(tidy_model = map(stats, tidy)) %>% # force the four test outputs to also be data frames in a list column ("tidy_model")
unnest(tidy_model, .drop = TRUE) %>% # unpack the list-column with results, drop the list-column we used to organize the data %>%
cohen_d_paired()
} else if (return_BF) {
df <- select(df, region, BF)
}
return(df)
}
Behavioral data per trial
Load
# List of files to load
dataDir <- here("data","behavior")
files <- list.files(dataDir, "_pertrial.txt", full.names = TRUE, recursive = TRUE)
# Function with data operations per file
load_trial_data <- function(filename) {
per_trial <- read_tsv(filename, col_names = c("block", "trial_per_block", "target_present", "response", "RT", "outcome"), col_types = 'iiiiic') # read the data, name the columns, assign correct classes
file_sub <- str_extract(filename, "S[0-9]{2}") # extract participant ID
per_trial <- per_trial %>%
mutate(participant = rep(file_sub,nrow(.)), # add column with participant ID
time = rep(seq(8), each = nrow(.)/8)) # make new column to split rows into 8ths (every 10 minutes)
}
# Execute the function for each file; bind into single data frame
per_trial <- map_df(files, load_trial_data)
Clean
participants_to_include <- c("S01","S03","S04","S05","S06","S07","S08","S11","S12","S15","S16","S18","S19","S21","S22","S23","S25","S27","S28","S29","S30")
per_trial <- per_trial %>%
filter(participant %in% participants_to_include) %>% # exclude participants not in list
select(participant, time, target_present:outcome) %>% # reorder columns
mutate(participant = parse_factor(participant,NULL), # create factors for statistical analysis
time = parse_factor(time,NULL))
## # A tibble: 50,400 x 6
## participant time target_present response RT outcome
## <fct> <fct> <int> <int> <int> <chr>
## 1 S01 1 0 0 0 Correct rejection
## 2 S01 1 0 0 0 Correct rejection
## 3 S01 1 0 0 0 Correct rejection
## 4 S01 1 0 0 0 Correct rejection
## 5 S01 1 0 0 0 Correct rejection
## 6 S01 1 0 0 0 Correct rejection
## 7 S01 1 0 0 0 Correct rejection
## 8 S01 1 1 1 467 Hit
## 9 S01 1 0 0 0 Correct rejection
## 10 S01 1 0 0 0 Correct rejection
## # ... with 50,390 more rows
For each participant and trial, we now have:
- participant: participant ID (e.g.
S01
)
- time: factor that splits data into 10-minute time periods (1-8)
- target_present:
1
if target (short line) was shown; 0
otherwise (long line)
- response:
1
if participant responded a target was present; 0
otherwise (no target present)
- RT: response time in milliseconds
- outcome: either
Hit
, Miss
, False alarm
or Correct rejection
Response time data
RM ANOVA
(Intercept) |
1 |
20 |
78708390.25 |
1785243.8 |
881.766 |
0.000 |
* |
0.973 |
0.978 |
time |
7 |
140 |
48285.99 |
376627.1 |
2.564 |
0.016 |
* |
0.022 |
0.114 |
|
|
2 |
time |
0.546 |
0.047 |
* |
0.691 |
0.033 |
* |
|
Main effect of time
on RT: F(3.82, 76.45) = 2.56, p = .047, \(\eta^2_p\) = .11
Follow-up tests
# compute t-tests
RT_1v6 <- t.test(RT_ttest$time_1, RT_ttest$time_6, paired = TRUE)
RT_1v7 <- t.test(RT_ttest$time_1, RT_ttest$time_7, paired = TRUE)
RT_1v8 <- t.test(RT_ttest$time_1, RT_ttest$time_8, paired = TRUE)
RT_6v7 <- t.test(RT_ttest$time_6, RT_ttest$time_7, paired = TRUE)
# put result in data frame, bind all 4 together
bind_rows(tidy(RT_1v6),
tidy(RT_1v7),
tidy(RT_1v8),
tidy(RT_6v7)) %>%
cohen_d_paired() %>% # add Cohen's d
bind_cols(tibble(condition = c("1v6", "1v7", "1v8", "6v7")), .) %>% # add column indiciating condition comparisons
kable(digits = 3) # display
1v6 |
-44.470 |
-2.786 |
0.011 |
20 |
-77.767 |
-11.172 |
Paired t-test |
two.sided |
0.608 |
1v7 |
-21.999 |
-1.577 |
0.130 |
20 |
-51.098 |
7.100 |
Paired t-test |
two.sided |
0.344 |
1v8 |
-48.188 |
-2.307 |
0.032 |
20 |
-91.754 |
-4.622 |
Paired t-test |
two.sided |
0.503 |
6v7 |
22.470 |
1.447 |
0.163 |
20 |
-9.923 |
54.864 |
Paired t-test |
two.sided |
0.316 |
RT_1v6_bf <- extractBF(ttestBF(RT_ttest$time_1, RT_ttest$time_6, paired = TRUE), onlybf = TRUE)
RT_1v7_bf <- extractBF(ttestBF(RT_ttest$time_1, RT_ttest$time_7, paired = TRUE), onlybf = TRUE)
RT_1v8_bf <- extractBF(ttestBF(RT_ttest$time_1, RT_ttest$time_8, paired = TRUE), onlybf = TRUE)
RT_6v7_bf <- extractBF(ttestBF(RT_ttest$time_6, RT_ttest$time_7, paired = TRUE), onlybf = TRUE)
tibble(condition = c("1v6", "1v7", "1v8", "6v7"),
bf = c(RT_1v6_bf, RT_1v7_bf, RT_1v8_bf, RT_6v7_bf)) %>%
kable(digits = 2)
1v6 |
4.52 |
1v7 |
0.66 |
1v8 |
1.95 |
6v7 |
0.56 |
- Difference in RT between block 6 and block 7: t(20) = 1.45, p = .163, d = 0.32, BF01 = 1.78
Signal detection data (Hit rate, False alarm rate, A’)
Trial counts per type
Correct rejection |
234.6 |
207 |
240 |
6.3 |
False alarm |
6.6 |
1 |
33 |
6.3 |
Hit |
32.7 |
10 |
54 |
10.5 |
Miss |
27.3 |
6 |
50 |
10.5 |
Sensitivity (A’)
RM ANOVA
(Intercept) |
1 |
20 |
128.222 |
0.155 |
16524.665 |
0 |
* |
0.998 |
0.999 |
time |
7 |
140 |
0.053 |
0.143 |
7.468 |
0 |
* |
0.152 |
0.272 |
|
|
2 |
time |
0.357 |
0.001 |
* |
0.412 |
0 |
* |
|
Main effect of time
on A’: F(2.50, 49.96) = 7.47, p < .001, \(\eta^2_p\) = .27
Paired t-tests
# compute t-tests, put result in data frame, bind all 4 together
A_1v6 <- t.test(A_ttest$time_1, A_ttest$time_6, paired = TRUE)
A_1v7 <- t.test(A_ttest$time_1, A_ttest$time_7, paired = TRUE)
A_1v8 <- t.test(A_ttest$time_1, A_ttest$time_8, paired = TRUE)
A_6v7 <- t.test(A_ttest$time_6, A_ttest$time_7, paired = TRUE)
bind_rows(tidy(A_1v6),
tidy(A_1v7 ),
tidy(A_1v8),
tidy(A_6v7)) %>%
cohen_d_paired() %>% # add Cohen's d
bind_cols(tibble(condition = c("1v6", "1v7", "1v8", "6v7")), .) %>% # add column indiciating condition comparisons
kable(digits = 3) # display
1v6 |
0.052 |
5.752 |
0.000 |
20 |
0.033 |
0.071 |
Paired t-test |
two.sided |
1.255 |
1v7 |
0.029 |
2.400 |
0.026 |
20 |
0.004 |
0.053 |
Paired t-test |
two.sided |
0.524 |
1v8 |
0.062 |
4.232 |
0.000 |
20 |
0.031 |
0.092 |
Paired t-test |
two.sided |
0.923 |
6v7 |
-0.024 |
-2.509 |
0.021 |
20 |
-0.044 |
-0.004 |
Paired t-test |
two.sided |
0.547 |
A_1v6_bf <- extractBF(ttestBF(A_ttest$time_1, A_ttest$time_6, paired = TRUE), onlybf = TRUE)
A_1v7_bf <- extractBF(ttestBF(A_ttest$time_1, A_ttest$time_7, paired = TRUE), onlybf = TRUE)
A_1v8_bf <- extractBF(ttestBF(A_ttest$time_1, A_ttest$time_8, paired = TRUE), onlybf = TRUE)
A_6v7_bf <- extractBF(ttestBF(A_ttest$time_6, A_ttest$time_7, paired = TRUE), onlybf = TRUE)
tibble(condition = c("1v6", "1v7", "1v8", "6v7"), bf = c(A_1v6_bf, A_1v7_bf, A_1v8_bf, A_6v7_bf)) %>%
kable(digits = 2)
1v6 |
1791.10 |
1v7 |
2.28 |
1v8 |
79.19 |
6v7 |
2.75 |
- Difference in A’ between block 1 and block 7: t(20) = 2.40, p = .026, d = 0.52, BF10 = 2.28
- Difference in A’ between block 1 and block 8: t(20) = 4.23, p < .001, d = 0.92, BF10 = 79.2
- Difference in A’ between block 6 and block 7: t(20) = -2.51, p = .021, d = -0.55, BF10 = 2.75
Hit rate
RM ANOVA
(Intercept) |
1 |
20 |
49.926 |
2.413 |
413.780 |
0 |
* |
0.921 |
0.954 |
time |
7 |
140 |
0.813 |
1.859 |
8.745 |
0 |
* |
0.160 |
0.304 |
|
|
2 |
time |
0.349 |
0 |
* |
0.402 |
0 |
* |
|
Main effect of time
on Hit rate: F(2.45, 48.92) = 8.74, p < .001, \(\eta^2_p\) = .30
Paired t-tests
# compute t-tests
Hit_1v6 <- t.test(HR_ttest$time_1, HR_ttest$time_6, paired = TRUE)
Hit_1v7 <- t.test(HR_ttest$time_1, HR_ttest$time_7, paired = TRUE)
Hit_1v8 <- t.test(HR_ttest$time_1, HR_ttest$time_8, paired = TRUE)
Hit_6v7 <- t.test(HR_ttest$time_6, HR_ttest$time_7, paired = TRUE)
# put result in data frame, bind all 4 together
bind_rows(tidy(Hit_1v6),
tidy(Hit_1v7),
tidy(Hit_1v8),
tidy(Hit_6v7)) %>%
cohen_d_paired() %>% # add Cohen's d
bind_cols(tibble(condition = c("1v6", "1v7", "1v8", "6v7")), .) %>% # add column indiciating condition comparisons
kable(digits = 3) # display
1v6 |
0.213 |
6.331 |
0.000 |
20 |
0.143 |
0.284 |
Paired t-test |
two.sided |
1.382 |
1v7 |
0.137 |
2.749 |
0.012 |
20 |
0.033 |
0.240 |
Paired t-test |
two.sided |
0.600 |
1v8 |
0.236 |
4.273 |
0.000 |
20 |
0.121 |
0.351 |
Paired t-test |
two.sided |
0.932 |
6v7 |
-0.077 |
-2.171 |
0.042 |
20 |
-0.151 |
-0.003 |
Paired t-test |
two.sided |
0.474 |
Hit_1v6_bf <- extractBF(ttestBF(HR_ttest$time_1, HR_ttest$time_6, paired = TRUE), onlybf = TRUE)
Hit_1v7_bf <- extractBF(ttestBF(HR_ttest$time_1, HR_ttest$time_7, paired = TRUE), onlybf = TRUE)
Hit_1v8_bf <- extractBF(ttestBF(HR_ttest$time_1, HR_ttest$time_8, paired = TRUE), onlybf = TRUE)
Hit_6v7_bf <- extractBF(ttestBF(HR_ttest$time_6, HR_ttest$time_7, paired = TRUE), onlybf = TRUE)
tibble(condition = c("1v6", "1v7", "1v8", "6v7"),
bf = c(Hit_1v6_bf, Hit_1v7_bf, Hit_1v8_bf, Hit_6v7_bf)) %>%
kable(., digits = 2)
1v6 |
5667.76 |
1v7 |
4.23 |
1v8 |
86.24 |
6v7 |
1.56 |
- Difference in Hit rate between block 6 and block 7: t(20) = -2.17, p = .042, d = -0.47, BF10 = 1.56
False alarm rate
RM ANOVA
(Intercept) |
1 |
20 |
0.086 |
0.064 |
26.816 |
0.00 |
* |
0.443 |
0.573 |
time |
7 |
140 |
0.005 |
0.044 |
2.302 |
0.03 |
* |
0.045 |
0.103 |
|
|
2 |
time |
0.441 |
0.084 |
|
0.53 |
0.071 |
|
|
Main effect of time
on false alarm rate: F(3.08, 61.69) = 2.30, p = .084, \(\eta^2_p\) = .10
Paired t-tests
# compute t-tests
FA_1v6 <- t.test(FAR_ttest$time_1, FAR_ttest$time_6, paired = TRUE)
FA_1v7 <- t.test(FAR_ttest$time_1, FAR_ttest$time_7, paired = TRUE)
FA_1v8 <- t.test(FAR_ttest$time_1, FAR_ttest$time_8, paired = TRUE)
FA_6v7 <- t.test(FAR_ttest$time_6, FAR_ttest$time_7, paired = TRUE)
# put result in data frame, bind all 4 together
bind_rows(tidy(FA_1v6),
tidy(FA_1v7),
tidy(FA_1v8),
tidy(FA_6v7)) %>%
cohen_d_paired() %>% # add Cohen's d
bind_cols(tibble(condition = c("1v6", "1v7", "1v8", "6v7")), .) %>% # add column indiciating condition comparisons
kable(digits = 3) # display
1v6 |
0.011 |
1.220 |
0.237 |
20 |
-0.008 |
0.030 |
Paired t-test |
two.sided |
0.266 |
1v7 |
0.017 |
2.910 |
0.009 |
20 |
0.005 |
0.030 |
Paired t-test |
two.sided |
0.635 |
1v8 |
0.007 |
0.852 |
0.405 |
20 |
-0.011 |
0.025 |
Paired t-test |
two.sided |
0.186 |
6v7 |
0.006 |
1.095 |
0.286 |
20 |
-0.006 |
0.018 |
Paired t-test |
two.sided |
0.239 |
FA_1v6_bf <- extractBF(ttestBF(FAR_ttest$time_1, FAR_ttest$time_6, paired = TRUE), onlybf = TRUE)
FA_1v7_bf <- extractBF(ttestBF(FAR_ttest$time_1, FAR_ttest$time_7, paired = TRUE), onlybf = TRUE)
FA_1v8_bf <- extractBF(ttestBF(FAR_ttest$time_1, FAR_ttest$time_8, paired = TRUE), onlybf = TRUE)
FA_6v7_bf <- extractBF(ttestBF(FAR_ttest$time_6, FAR_ttest$time_7, paired = TRUE), onlybf = TRUE)
tibble(condition = c("1v6", "1v7", "1v8", "6v7"), bf = c(FA_1v6_bf,FA_1v7_bf,FA_1v8_bf,FA_6v7_bf)) %>%
kable(digits = 2)
1v6 |
0.44 |
1v7 |
5.69 |
1v8 |
0.31 |
6v7 |
0.39 |
- Difference in false alarm rate between block 6 and block 7: t(20) = 1.10, p = .286, d = 0.24, BF10 = 2.59
Ratings data
Load
# Lists of files to load
dataDir <- here("data","behavior")
files_mot <- list.files(dataDir, "_motivation.txt", full.names = TRUE, recursive = TRUE)
files_av <- list.files(dataDir, "_aversion.txt", full.names = TRUE, recursive = TRUE)
# Function with data operations per file
load_ratings_data <- function(filenames_mot, filenames_av) {
file_sub <- str_extract(filenames_mot, "S[0-9]{2}") # extract participant ID
motivation <- read_tsv(filenames_mot, col_names = "motivation", col_types = 'i')
aversion <- read_tsv(filenames_av, col_names = "aversion", col_types = 'i')
ratings <- bind_cols(motivation,aversion) %>% # combine motivation and aversion scores
mutate(participant = rep(file_sub,nrow(.)), # add column with participant ID
time = c("begin","1","2","3","4","5","6","post","7","8")) # add column with time point labels
}
# Execute the function for each file; bind into single data frame
ratings <- map2_df(files_mot,files_av, load_ratings_data)
Clean
participants_to_include <- c("S01","S03","S04","S05","S06","S07","S08","S11","S12","S15","S16","S18","S19","S21","S22","S23","S25","S27","S28","S29","S30")
ratings <- ratings %>%
filter(participant %in% participants_to_include) %>% # exclude participants not in list
select(participant, time, motivation, aversion) %>% # reorder ratings columns
mutate(participant = parse_factor(participant,NULL), # create factors for statistical analysis
time = parse_factor(time, levels = c("begin","1","2","3","4","5","6","post","7","8")))
## # A tibble: 210 x 4
## participant time motivation aversion
## <fct> <fct> <int> <int>
## 1 S01 begin 6 3
## 2 S01 1 7 3
## 3 S01 2 7 2
## 4 S01 3 6 5
## 5 S01 4 4 5
## 6 S01 5 3 5
## 7 S01 6 3 6
## 8 S01 post 5 5
## 9 S01 7 6 4
## 10 S01 8 4 6
## # ... with 200 more rows
For each participant, we now have:
- participant: participant ID (e.g.
S01
)
- time: 10 time point when rating was taken. 8 are numbers, indicating ratings after a block of 10 minutes (e.g.
6
is after 60
minutes of task performance). begin
is the rating before the task started; post
is the rating directly after the motivation instruction that was shown after block 6.
- motivation: 7-point scale rating of aversion to continue the task (
1
is no aversion, 7
is strongest aversion)
- aversion: 7-point scale rating of motivation to continue the task (
1
is no motivation, 7
is strongest motivation)
Motivation
RM ANOVA
(Intercept) |
1 |
20 |
4004.233 |
208.467 |
384.161 |
0 |
* |
0.899 |
0.951 |
time |
9 |
180 |
86.576 |
243.724 |
7.104 |
0 |
* |
0.161 |
0.262 |
|
|
2 |
time |
0.432 |
0 |
* |
0.55 |
0 |
* |
|
Main effect of time
on motivation: F(3.89, 77.80) = 7.10, p < .001, \(\eta^2_p\) = .26
Paired t-tests
# compute t-tests
Mot_beginV6 <- t.test(Mot_ttest$time_begin, Mot_ttest$time_6, paired = TRUE)
Mot_beginVpost <- t.test(Mot_ttest$time_begin, Mot_ttest$time_post, paired = TRUE)
Mot_beginV8 <- t.test(Mot_ttest$time_begin, Mot_ttest$time_8, paired = TRUE)
Mot_6Vpost <- t.test(Mot_ttest$time_6, Mot_ttest$time_post, paired = TRUE)
# put result in data frame, bind all 4 together
bind_rows(tidy(Mot_beginV6),
tidy(Mot_beginVpost),
tidy(Mot_beginV8),
tidy(Mot_6Vpost)) %>%
cohen_d_paired() %>% # add Cohen's d
bind_cols(tibble(condition = c("begin vs. 6", "begin vs. post", "begin vs. 8", "6 vs. post")), .) %>% # add column indiciating condition comparisons
kable(digits = 3) # display
begin vs. 6 |
1.524 |
3.553 |
0.002 |
20 |
0.629 |
2.418 |
Paired t-test |
two.sided |
0.775 |
begin vs. post |
-0.571 |
-1.743 |
0.097 |
20 |
-1.255 |
0.112 |
Paired t-test |
two.sided |
0.380 |
begin vs. 8 |
0.762 |
1.817 |
0.084 |
20 |
-0.113 |
1.636 |
Paired t-test |
two.sided |
0.397 |
6 vs. post |
-2.095 |
-5.139 |
0.000 |
20 |
-2.946 |
-1.245 |
Paired t-test |
two.sided |
1.121 |
Mot_beginV6_bf <- extractBF(ttestBF(Mot_ttest$time_begin, Mot_ttest$time_6, paired = TRUE), onlybf = TRUE)
Mot_beginVpost_bf <- extractBF(ttestBF(Mot_ttest$time_begin, Mot_ttest$time_post, paired = TRUE), onlybf = TRUE)
Mot_beginV8_bf <- extractBF(ttestBF(Mot_ttest$time_begin, Mot_ttest$time_8, paired = TRUE), onlybf = TRUE)
Mot_6Vpost_bf <- extractBF(ttestBF(Mot_ttest$time_6, Mot_ttest$time_post, paired = TRUE), onlybf = TRUE)
tibble(condition = c("begin vs. 6", "begin vs. post", "begin vs. 8", "6 vs. post"),
bf = c(Mot_beginV6_bf, Mot_beginVpost_bf, Mot_beginV8_bf, Mot_6Vpost_bf)) %>%
kable(digits = 2)
begin vs. 6 |
19.89 |
begin vs. post |
0.82 |
begin vs. 8 |
0.91 |
6 vs. post |
514.52 |
- Difference in motivation between begin and block 6: t(20) = 3.55, p = .002, d = 0.78, BF10 = 19.9
- Difference in motivation between block 6 and post: t(20) = -5.14, p < .001, d = -1.12, BF10 = 515
- Difference in motivation between begin and post: t(20) = -1.74, p = .097, d = -0.38, BF01 = 1.21
- Difference in motivation between begin and block 8: t(20) = 1.82, p = .084, d = 0.40, BF01 = 1.09
Aversion
RM ANOVA
(Intercept) |
1 |
20 |
4109.719 |
443.981 |
185.130 |
0 |
* |
0.867 |
0.903 |
time |
9 |
180 |
119.186 |
188.114 |
12.672 |
0 |
* |
0.159 |
0.388 |
|
|
2 |
time |
0.384 |
0 |
* |
0.474 |
0 |
* |
|
Main effect of time
on aversion: F(3.46, 69.17) = 12.67, p < .001, \(\eta^2_p\) = .39
Paired t-tests
# compute t-tests
Av_beginV6 <- t.test(Av_ttest$time_begin, Av_ttest$time_6, paired = TRUE)
Av_beginVpost <- t.test(Av_ttest$time_begin, Av_ttest$time_post, paired = TRUE)
Av_beginV8 <- t.test(Av_ttest$time_begin, Av_ttest$time_8, paired = TRUE)
Av_6Vpost <- t.test(Av_ttest$time_6, Av_ttest$time_post, paired = TRUE)
# put result in data frame, bind all 4 together
bind_rows(tidy(Av_beginV6),
tidy(Av_beginVpost),
tidy(Av_beginV8),
tidy(Av_6Vpost)) %>%
cohen_d_paired() %>% # add Cohen's d
bind_cols(tibble(condition = c("begin vs. 6", "begin vs. post", "begin vs. 8", "6 vs. post")), .) %>% # add column indiciating condition comparisons
kable(digits = 3) # display
begin vs. 6 |
-2.667 |
-6.162 |
0.000 |
20 |
-3.569 |
-1.764 |
Paired t-test |
two.sided |
1.345 |
begin vs. post |
-2.000 |
-4.369 |
0.000 |
20 |
-2.955 |
-1.045 |
Paired t-test |
two.sided |
0.953 |
begin vs. 8 |
-2.381 |
-4.591 |
0.000 |
20 |
-3.463 |
-1.299 |
Paired t-test |
two.sided |
1.002 |
6 vs. post |
0.667 |
3.162 |
0.005 |
20 |
0.227 |
1.106 |
Paired t-test |
two.sided |
0.690 |
Av_beginV6_bf <- extractBF(ttestBF(Av_ttest$time_begin, Av_ttest$time_6, paired = TRUE), onlybf = TRUE)
Av_beginVpost_bf <- extractBF(ttestBF(Av_ttest$time_begin, Av_ttest$time_post, paired = TRUE), onlybf = TRUE)
Av_beginV8_bf <- extractBF(ttestBF(Av_ttest$time_begin, Av_ttest$time_8, paired = TRUE), onlybf = TRUE)
Av_6Vpost_bf <- extractBF(ttestBF(Av_ttest$time_6, Av_ttest$time_post, paired = TRUE), onlybf = TRUE)
tibble(condition = c("begin vs. 6", "begin vs. post", "begin vs. 8", "6 vs. post"),
bf = c(Av_beginV6_bf, Av_beginVpost_bf, Av_beginV8_bf, Av_6Vpost_bf)) %>%
kable(digits = 2)
begin vs. 6 |
4057.15 |
begin vs. post |
105.14 |
begin vs. 8 |
166.27 |
6 vs. post |
9.20 |
- Difference in aversion between begin and block 6: t(20) = -6.16, p < .001, d = -1.34, BF10 = 4057
- Difference in aversion between block 6 and post: t(20) = 3.16, p = .005, d = 0.69, BF10 = 9.2
EEG data
Theta - ITPC
Load the files with EEG data for statistics, written out from MATLAB
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
Correct rejections (10 minutes)
ITPC_10m <- reduce(list(ITPC_10m_lPO, ITPC_10m_rPO, ITPC_10m_MF),full_join) %>%
select(-X26,-ends_with("_time"), -ends_with("_freq")) %>% # drop spurious and peak time/frequency columns
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","time"), extra = "drop", sep = "\\_Correct_rejection_|\\_t") %>% # split into electrode pool (3) and time (8)
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X26")
## Joining, by = c("subnum", "X26")
RM ANOVA
(Intercept) |
1 |
20 |
64.538 |
9.348 |
138.079 |
0.000 |
* |
0.836 |
0.873 |
time |
7 |
140 |
0.161 |
0.721 |
4.463 |
0.000 |
* |
0.013 |
0.182 |
region |
2 |
40 |
2.328 |
2.227 |
20.907 |
0.000 |
* |
0.156 |
0.511 |
time:region |
14 |
280 |
0.030 |
0.338 |
1.799 |
0.038 |
* |
0.002 |
0.083 |
|
2 |
time |
0.076 |
0.019 |
* |
3 |
region |
0.739 |
0.057 |
|
4 |
time:region |
0.000 |
0.159 |
|
|
2 |
time |
0.547 |
0.003 |
* |
0.692 |
0.001 |
* |
3 |
region |
0.793 |
0.000 |
* |
0.850 |
0.000 |
* |
4 |
time:region |
0.552 |
0.084 |
|
0.934 |
0.043 |
* |
|
Main effect of time
on theta ITPC: F(3.83, 76.52) = 4.46, p = .003, \(\eta^2_p\) = .18
Paired t-tests
PO7P5P7 |
20.073 |
-0.046 |
-3.558 |
0.002 |
20 |
-0.072 |
-0.019 |
Paired t-test |
two.sided |
0.776 |
PO8P6P8 |
1.086 |
-0.027 |
-1.936 |
0.067 |
20 |
-0.056 |
0.002 |
Paired t-test |
two.sided |
0.422 |
FCzFC1FC2 |
8.643 |
-0.046 |
-3.130 |
0.005 |
20 |
-0.077 |
-0.015 |
Paired t-test |
two.sided |
0.683 |
PO7P5P7 |
20.07 |
PO8P6P8 |
1.09 |
FCzFC1FC2 |
8.64 |
- Difference in theta ITPC between block 6 and 7 in
left PO
electrodes: t(20) = -3.56, p = .002, d = -0.78, BF10 = 20.1
- Difference in theta ITPC between block 6 and 7 in
right PO
electrodes: t(20) = -1.94, p = .067, d = -0.42, BF10 = 1.09
- Difference in theta ITPC between block 6 and 7 in
MF
electrodes: t(20) = -3.13, p = .005, d = -0.68, BF10 = 8.64
Multilevel model
- Response: A’
- Fixed effect: ITPC
- Random intercept: -
- Random slope: -
- Nesting structure: time points nested in subjects
- Correlation structure: First-order autoregressive
# The order/naming of the subjects in the behavioral ("participant") and EEG ("subnum") dataframes is not consistent; this provises the mapping
subject_order_EEG <- tibble(subnum = seq(1,21), participant = c('S11','S12','S15','S16','S18','S19','S01','S21','S22','S23','S25','S27','S28','S29','S30','S03', 'S04','S05','S06','S07','S08'))
ITPC_SDT_10m_mixed <- ITPC_10m %>%
mutate(subnum = as.integer(subnum)) %>% # coerce subnum from ITPC_10m to be integer (to match in subject_order_eeg)
left_join(.,subject_order_EEG, by = "subnum") %>% # add the "participant" mapping column
# make these columns match the SDT data frame
mutate(participant = parse_factor(participant, levels = levels(SDT$participant)), # participant is a factor in SDT, and in different order
time = parse_factor(as.integer(time), levels = NULL)) %>% # time goes from 1 to 8 and is a factor in SDT
left_join(.,SDT, by = c("time","participant")) %>% # add the SDT data
mutate(time = as.integer(time)) %>% # repeated measure ID has to be integer for the models
rename(ITPC = voltage) # rename "voltage" column from ITPC data frame
rPO:
## Generalized least squares fit by REML
## Model: a_prime ~ ITPC
## Data: .
## Subset: region == "PO8P6P8"
## AIC BIC logLik
## -633.5932 -621.1452 320.7966
##
## Correlation Structure: AR(1)
## Formula: ~time | participant
## Parameter estimate(s):
## Phi
## 0.6963717
##
## Coefficients:
## Value Std.Error t-value p-value
## (Intercept) 0.8246873 0.01479529 55.73984 0e+00
## ITPC 0.1130090 0.02902639 3.89332 1e-04
##
## Correlation:
## (Intr)
## ITPC -0.89
##
## Standardized residuals:
## Min Q1 Med Q3 Max
## -2.46020657 -0.71526578 -0.02120056 0.60097948 2.05325350
##
## Residual standard error: 0.04632284
## Degrees of freedom: 168 total; 166 residual
lPO:
## Generalized least squares fit by REML
## Model: a_prime ~ ITPC
## Data: .
## Subset: region == "PO7P5P7"
## AIC BIC logLik
## -627.6256 -615.1777 317.8128
##
## Correlation Structure: AR(1)
## Formula: ~time | participant
## Parameter estimate(s):
## Phi
## 0.7517676
##
## Coefficients:
## Value Std.Error t-value p-value
## (Intercept) 0.8432367 0.01326363 63.57510 0.0000
## ITPC 0.1145791 0.03688280 3.10657 0.0022
##
## Correlation:
## (Intr)
## ITPC -0.805
##
## Standardized residuals:
## Min Q1 Med Q3 Max
## -2.49982851 -0.62840807 0.03004564 0.65998032 1.84162189
##
## Residual standard error: 0.0508978
## Degrees of freedom: 168 total; 166 residual
MF:
## Generalized least squares fit by REML
## Model: a_prime ~ ITPC
## Data: .
## Subset: region == "FCzFC1FC2"
## AIC BIC logLik
## -635.6804 -623.2325 321.8402
##
## Correlation Structure: AR(1)
## Formula: ~time | participant
## Parameter estimate(s):
## Phi
## 0.7030903
##
## Coefficients:
## Value Std.Error t-value p-value
## (Intercept) 0.8254778 0.01400682 58.93401 0e+00
## ITPC 0.1469372 0.03558883 4.12874 1e-04
##
## Correlation:
## (Intr)
## ITPC -0.874
##
## Standardized residuals:
## Min Q1 Med Q3 Max
## -2.32801071 -0.66794111 0.01643409 0.63781178 2.23474612
##
## Residual standard error: 0.04646776
## Degrees of freedom: 168 total; 166 residual
Hits and misses (20 minutes)
ITPC_20m <- reduce(list(ITPC_20m_lPO, ITPC_20m_rPO, ITPC_20m_MF), full_join) %>%
select(-X26,-ends_with("_time"), -ends_with("_freq")) %>% #
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","condition","time"), extra = "merge", sep = "_") %>% # split into region (3), condition (2) and time (4). Split after underscore (but stop after splitting into 3 columns)
mutate(time = str_replace(time,"_t.+","")) %>% # remove unnecessary info after last underscore in time vector
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
condition = parse_factor(condition, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X26")
## Joining, by = c("subnum", "X26")
RM ANOVA
(Intercept) |
1 |
20 |
83.4314806 |
6.2077650 |
268.797161 |
0.0000000 |
* |
0.8855208 |
0.9307472 |
time |
3 |
60 |
0.1643773 |
0.7534134 |
4.363537 |
0.0075997 |
* |
0.0150112 |
0.1791011 |
region |
2 |
40 |
1.3826828 |
1.7153602 |
16.121195 |
0.0000073 |
* |
0.1136270 |
0.4463085 |
condition |
1 |
20 |
1.8009405 |
0.6177012 |
58.311058 |
0.0000002 |
* |
0.1430809 |
0.7446082 |
time:region |
6 |
120 |
0.0329346 |
0.4527114 |
1.454994 |
0.1995046 |
|
0.0030442 |
0.0678161 |
time:condition |
3 |
60 |
0.0292374 |
0.4203938 |
1.390952 |
0.2542835 |
|
0.0027034 |
0.0650252 |
region:condition |
2 |
40 |
0.1092865 |
0.2652160 |
8.241321 |
0.0010067 |
* |
0.0100307 |
0.2918178 |
time:region:condition |
6 |
120 |
0.0194744 |
0.3533687 |
1.102212 |
0.3651112 |
|
0.0018023 |
0.0522321 |
|
2 |
time |
0.5022246 |
0.0246778 |
* |
3 |
region |
0.8480515 |
0.2089350 |
|
5 |
time:region |
0.4093961 |
0.7301661 |
|
6 |
time:condition |
0.8781756 |
0.7870651 |
|
7 |
region:condition |
0.7943573 |
0.1122408 |
|
8 |
time:region:condition |
0.1647764 |
0.0456248 |
* |
|
2 |
time |
0.6811105 |
0.0185383 |
* |
0.7594201 |
0.0148678 |
* |
3 |
region |
0.8680944 |
0.0000240 |
* |
0.9433946 |
0.0000122 |
* |
5 |
time:region |
0.7535219 |
0.2172721 |
|
1.0007596 |
0.1995046 |
|
6 |
time:condition |
0.9313545 |
0.2560163 |
|
1.0979803 |
0.2542835 |
|
7 |
region:condition |
0.8294331 |
0.0021491 |
* |
0.8951516 |
0.0016035 |
* |
8 |
time:region:condition |
0.6811810 |
0.3616961 |
|
0.8779956 |
0.3645042 |
|
|
- Main effect of
condition
on theta ITPC: F(1, 20) = 58.31, p < .001, \(\eta^2_p\) = .74
- Theta ITPC:
time
by condition
interaction theta ITPC: F(3, 60) = 1.39, p = .254, \(\eta^2_p\) = .07
Theta - Power
Load the files with EEG data for statistics, written out from MATLAB
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
## Warning: Missing column names filled in: 'X26' [26]
Correct rejections (10 minutes)
power_10m <- reduce(list(power_10m_lPO, power_10m_rPO, power_10m_MF),full_join) %>%
select(-X26,-ends_with("_time"), -ends_with("_freq")) %>% # drop spurious and peak time/frequency columns
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","time"), extra = "drop", sep = "\\_Correct_rejection_|\\_t") %>% # split into electrode pool (3) and time (8)
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X26")
## Joining, by = c("subnum", "X26")
RM ANOVA
(Intercept) |
1 |
20 |
924.033 |
417.848 |
44.228 |
0.000 |
* |
0.586 |
0.689 |
time |
7 |
140 |
17.375 |
70.812 |
4.907 |
0.000 |
* |
0.026 |
0.197 |
region |
2 |
40 |
70.503 |
130.765 |
10.783 |
0.000 |
* |
0.098 |
0.350 |
time:region |
14 |
280 |
1.396 |
32.831 |
0.851 |
0.613 |
|
0.002 |
0.041 |
|
2 |
time |
0.013 |
0.000 |
* |
3 |
region |
0.964 |
0.709 |
|
4 |
time:region |
0.000 |
0.057 |
|
|
2 |
time |
0.435 |
0.004 |
* |
0.521 |
0.002 |
* |
3 |
region |
0.966 |
0.000 |
* |
1.067 |
0.000 |
* |
4 |
time:region |
0.495 |
0.547 |
|
0.785 |
0.590 |
|
|
Main effect of time
on theta power: F(3.04, 60.85) = 4.91, p = .004, \(\eta^2_p\) = .20
Paired t-tests
PO7P5P7 |
0.274 |
0.109 |
0.646 |
0.525 |
20 |
-0.242 |
0.459 |
Paired t-test |
two.sided |
0.141 |
PO8P6P8 |
0.313 |
0.115 |
0.844 |
0.409 |
20 |
-0.169 |
0.399 |
Paired t-test |
two.sided |
0.184 |
FCzFC1FC2 |
0.468 |
0.137 |
1.285 |
0.214 |
20 |
-0.085 |
0.359 |
Paired t-test |
two.sided |
0.280 |
PO7P5P7 |
0.27 |
PO8P6P8 |
0.31 |
FCzFC1FC2 |
0.47 |
- Difference in theta power between block 6 and 7 in
left PO
electrodes: t(20) = 0.65, p = .525, d = 0.14, BF01 = 3.64
- Difference in theta power between block 6 and 7 in
right PO
electrodes: t(20) = 0.84, p = .409, d = 0.18, BF01 = 3.2
- Difference in theta power between block 6 and 7 in
MF
electrodes: t(20) = 1.28, p = .214, d = 0.28, BF01 = 2.14
Hits and misses (20 minutes)
power_20m <- reduce(list(power_20m_lPO, power_20m_rPO, power_20m_MF), full_join) %>%
select(-X26,-ends_with("_time"), -ends_with("_freq")) %>%
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","condition","time"), extra = "merge", sep = "_") %>% # split into region (3), condition (2) and time (4). Split after underscore (but stop after splitting into 3 columns)
mutate(time = str_replace(time,"_t.+","")) %>% # remove unnecessary info after last underscore in time vector
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
condition = parse_factor(condition, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X26")
## Joining, by = c("subnum", "X26")
RM ANOVA
(Intercept) |
1 |
20 |
1375.376 |
291.044 |
94.513 |
0.000 |
* |
0.655 |
0.825 |
time |
3 |
60 |
15.207 |
73.126 |
4.159 |
0.010 |
* |
0.021 |
0.172 |
region |
2 |
40 |
59.714 |
165.422 |
7.220 |
0.002 |
* |
0.076 |
0.265 |
condition |
1 |
20 |
101.678 |
47.271 |
43.019 |
0.000 |
* |
0.123 |
0.683 |
time:region |
6 |
120 |
2.691 |
53.747 |
1.001 |
0.428 |
|
0.004 |
0.048 |
time:condition |
3 |
60 |
1.722 |
33.237 |
1.036 |
0.383 |
|
0.002 |
0.049 |
region:condition |
2 |
40 |
3.843 |
36.673 |
2.096 |
0.136 |
|
0.005 |
0.095 |
time:region:condition |
6 |
120 |
0.694 |
25.228 |
0.550 |
0.769 |
|
0.001 |
0.027 |
|
2 |
time |
0.760 |
0.400 |
|
3 |
region |
0.925 |
0.476 |
|
5 |
time:region |
0.136 |
0.019 |
* |
6 |
time:condition |
0.876 |
0.779 |
|
7 |
region:condition |
0.660 |
0.019 |
* |
8 |
time:region:condition |
0.411 |
0.735 |
|
|
2 |
time |
0.867 |
0.014 |
* |
1.008 |
0.010 |
* |
3 |
region |
0.930 |
0.003 |
* |
1.022 |
0.002 |
* |
5 |
time:region |
0.584 |
0.406 |
|
0.724 |
0.415 |
|
6 |
time:condition |
0.928 |
0.380 |
|
1.093 |
0.383 |
|
7 |
region:condition |
0.746 |
0.151 |
|
0.793 |
0.148 |
|
8 |
time:region:condition |
0.769 |
0.724 |
|
1.028 |
0.769 |
|
|
- Main effect of
condition
on theta power: F(1, 20) = 43.02, p < .001, \(\eta^2_p\) = .68
- Theta power:
time
by condition
interaction theta power: F(3, 60) = 1.04, p = .383, \(\eta^2_p\) = .05
ERPs - P1
Load the files with EEG data for statistics, written out from MATLAB
## Warning: Missing column names filled in: 'X18' [18]
## Warning: Missing column names filled in: 'X18' [18]
## Warning: Missing column names filled in: 'X18' [18]
## Warning: Missing column names filled in: 'X18' [18]
Correct rejections (10 minutes)
P1_10m <- full_join(P1_10m_lPO,P1_10m_rPO) %>%
select(-X18,-ends_with("_time")) %>% # drop spurious and peak time columns
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","time"), extra = "drop", sep = "\\_Correct_rejection_|\\_t") %>% # split into region (2) and time (8)
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X18")
RM ANOVA
(Intercept) |
1 |
20 |
278.878349 |
142.91960 |
39.0259077 |
0.0000042 |
* |
0.4745800 |
0.6611657 |
time |
7 |
140 |
3.513505 |
60.35357 |
1.1643071 |
0.3271770 |
|
0.0112516 |
0.0550128 |
region |
1 |
20 |
47.393079 |
72.52800 |
13.0689061 |
0.0017267 |
* |
0.1330718 |
0.3952023 |
time:region |
7 |
140 |
0.468308 |
32.95234 |
0.2842336 |
0.9592468 |
|
0.0015145 |
0.0140125 |
|
2 |
time |
0.0545227 |
0.0043692 |
* |
4 |
time:region |
0.1801815 |
0.3314069 |
|
|
2 |
time |
0.5264141 |
0.3326329 |
|
0.6600623 |
0.3325955 |
|
4 |
time:region |
0.7198980 |
0.9218219 |
|
0.9914061 |
0.9584455 |
|
|
- Main effect of
time
on P1: F(3.68, 73.70) = 1.16, p = .333, \(\eta^2_p\) = .06
- Main effect of
hemisphere
on P1: F(1, 20) = 13.07, p = .002, \(\eta^2_p\) = .40
Paired t-tests
PO7P5P7 |
0.496 |
-0.250 |
-1.338 |
0.196 |
20 |
-0.640 |
0.140 |
Paired t-test |
two.sided |
0.292 |
PO8P6P8 |
0.963 |
-0.283 |
-1.854 |
0.079 |
20 |
-0.601 |
0.035 |
Paired t-test |
two.sided |
0.405 |
PO7P5P7 |
0.50 |
PO8P6P8 |
0.96 |
Hits and misses (20 minutes)
P1_20m <- full_join(P1_20m_lPO,P1_20m_rPO) %>%
select(-X18,-ends_with("_time")) %>%
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","condition","time"), extra = "merge", sep = "\\s|\\_") %>% # split into region (2), condition (2) and time (4). Split after space or underscore
mutate(time = str_replace(time,"_t.+","")) %>% # remove unnecessary info after underscore in time vector
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
condition = parse_factor(condition, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X18")
RM ANOVA
(Intercept) |
1 |
20 |
260.018 |
159.027 |
32.701 |
0.000 |
* |
0.344 |
0.621 |
time |
3 |
60 |
3.865 |
85.910 |
0.900 |
0.447 |
|
0.008 |
0.043 |
region |
1 |
20 |
35.928 |
52.503 |
13.686 |
0.001 |
* |
0.067 |
0.406 |
condition |
1 |
20 |
7.634 |
22.832 |
6.687 |
0.018 |
* |
0.015 |
0.251 |
time:region |
3 |
60 |
1.182 |
47.461 |
0.498 |
0.685 |
|
0.002 |
0.024 |
time:condition |
3 |
60 |
0.871 |
53.399 |
0.326 |
0.806 |
|
0.002 |
0.016 |
region:condition |
1 |
20 |
7.991 |
21.378 |
7.476 |
0.013 |
* |
0.016 |
0.272 |
time:region:condition |
3 |
60 |
1.434 |
54.184 |
0.529 |
0.664 |
|
0.003 |
0.026 |
|
2 |
time |
0.523 |
0.033 |
* |
5 |
time:region |
0.726 |
0.308 |
|
6 |
time:condition |
0.766 |
0.418 |
|
8 |
time:region:condition |
0.710 |
0.270 |
|
|
2 |
time |
0.709 |
0.420 |
|
0.796 |
0.429 |
|
5 |
time:region |
0.858 |
0.657 |
|
0.996 |
0.684 |
|
6 |
time:condition |
0.839 |
0.771 |
|
0.969 |
0.800 |
|
8 |
time:region:condition |
0.841 |
0.634 |
|
0.972 |
0.659 |
|
|
- P1 amplitude:
region
by condition
interaction: F(1, 20) = 7.48, p = .013, \(\eta^2_p\) = .27
- P1 amplitude:
time
by region
by condition
interaction: F(3, 60) = 0.53, p = .664, \(\eta^2_p\) = .03
ERPs - N1
Load the files with EEG data for statistics, written out from MATLAB
## Warning: Missing column names filled in: 'X18' [18]
## Warning: Missing column names filled in: 'X18' [18]
## Warning: Missing column names filled in: 'X18' [18]
## Warning: Missing column names filled in: 'X18' [18]
Correct rejections (10 minutes)
N1_10m <- full_join(N1_10m_lPO,N1_10m_rPO) %>%
select(-X18,-ends_with("_time")) %>% # drop spurious and peak time columns
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","time"), extra = "drop", sep = "\\_Correct_rejection_|\\_t") %>% # split into region (2) and time (8)
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X18")
RM ANOVA
(Intercept) |
1 |
20 |
491.592 |
677.571 |
14.510 |
0.001 |
* |
0.294 |
0.420 |
time |
7 |
140 |
23.605 |
81.507 |
5.792 |
0.000 |
* |
0.020 |
0.225 |
region |
1 |
20 |
287.641 |
376.592 |
15.276 |
0.001 |
* |
0.196 |
0.433 |
time:region |
7 |
140 |
9.247 |
46.226 |
4.001 |
0.001 |
* |
0.008 |
0.167 |
|
2 |
time |
0.017 |
0.000 |
* |
4 |
time:region |
0.078 |
0.021 |
* |
|
2 |
time |
0.412 |
0.002 |
* |
0.490 |
0.001 |
* |
4 |
time:region |
0.620 |
0.004 |
* |
0.814 |
0.001 |
* |
|
- Main effect of
time
on N1: F(2.89, 57.75) = 5.79, p = .002, \(\eta^2_p\) = .22
- Main effect of
hemiphere
on N1: F(1, 20) = 15.28, p < .001, \(\eta^2_p\) = .43
Paired t-tests
PO7P5P7 |
0.290 |
0.126 |
0.734 |
0.472 |
20 |
-0.231 |
0.483 |
Paired t-test |
two.sided |
0.160 |
PO8P6P8 |
0.239 |
-0.052 |
-0.334 |
0.742 |
20 |
-0.380 |
0.275 |
Paired t-test |
two.sided |
0.073 |
PO7P5P7 |
0.29 |
PO8P6P8 |
0.24 |
- Difference in N1 between block 6 and 7 in
left PO
regions: t(20) = 0.73, p = .472, d = 0.16, BF01 = 3.45
- Difference in N1 between block 6 and 7 in
right PO
regions: t(20) = -0.33, p = .742, d = -0.07, BF01 = 4.18
Hits and misses (20 minutes)
N1_20m <- full_join(N1_20m_lPO,N1_20m_rPO) %>%
select(-X18,-ends_with("_time")) %>% # also drop correct rejections (if there)
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","condition","time"), extra = "merge", sep = "\\s|\\_") %>% # split into region (2), condition (2) and time (4). Split after space or underscore
mutate(time = str_replace(time,"_t.+","")) %>% # remove unnecessary info after underscore in time vector
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
region = parse_factor(region, levels = NULL),
condition = parse_factor(condition, levels = NULL),
time = parse_factor(time, levels = NULL))
## Joining, by = c("subnum", "X18")
RM ANOVA
(Intercept) |
1 |
20 |
609.706 |
607.240 |
20.081 |
0.000 |
* |
0.299 |
0.501 |
time |
3 |
60 |
9.817 |
86.333 |
2.274 |
0.089 |
|
0.007 |
0.102 |
region |
1 |
20 |
362.837 |
347.975 |
20.854 |
0.000 |
* |
0.203 |
0.510 |
condition |
1 |
20 |
51.167 |
61.268 |
16.702 |
0.001 |
* |
0.035 |
0.455 |
time:region |
3 |
60 |
2.127 |
58.460 |
0.728 |
0.539 |
|
0.001 |
0.035 |
time:condition |
3 |
60 |
1.840 |
106.349 |
0.346 |
0.792 |
|
0.001 |
0.017 |
region:condition |
1 |
20 |
40.250 |
67.874 |
11.860 |
0.003 |
* |
0.027 |
0.372 |
time:region:condition |
3 |
60 |
7.896 |
92.973 |
1.699 |
0.177 |
|
0.005 |
0.078 |
|
2 |
time |
0.811 |
0.560 |
|
5 |
time:region |
0.940 |
0.949 |
|
6 |
time:condition |
0.626 |
0.119 |
|
8 |
time:region:condition |
0.859 |
0.725 |
|
|
2 |
time |
0.892 |
0.097 |
|
1.042 |
0.089 |
|
5 |
time:region |
0.963 |
0.535 |
|
1.143 |
0.539 |
|
6 |
time:condition |
0.752 |
0.735 |
|
0.852 |
0.760 |
|
8 |
time:region:condition |
0.912 |
0.182 |
|
1.071 |
0.177 |
|
|
- N1 amplitude:
hemisphere
by condition
interaction: F(1, 20) = 11.86, p = .003, \(\eta^2_p\) = .37
- N1 amplitude:
time
by hemisphere
by condition
interaction: F(3, 60) = 1.70, p = .177, \(\eta^2_p\) = .08
Power lateralization - Alpha
Load the files with EEG data for statistics, written out from MATLAB
## Warning: Missing column names filled in: 'X10' [10]
## Warning: Missing column names filled in: 'X10' [10]
Correct rejections (10 minutes)
RM ANOVA
(Intercept) |
1 |
20 |
0.820 |
4.186 |
3.916 |
0.062 |
|
0.157 |
0.164 |
time |
7 |
140 |
0.011 |
0.231 |
0.938 |
0.479 |
|
0.002 |
0.045 |
|
|
2 |
time |
0.503 |
0.438 |
|
0.624 |
0.452 |
|
|
Main effect of time
on alpha lateralization: F(3.52, 70.42) = 0.94, p = .438, \(\eta^2_p\) = .04
Paired t-tests
6 vs. 7:
PO8P6P8 |
0.229 |
0.001 |
0.101 |
0.92 |
20 |
-0.022 |
0.024 |
Paired t-test |
two.sided |
0.022 |
Difference in alpha lateralization between block 6 and 7: t(20) = 0.10, p = .920, d = 0.02, BF01 = 4.38
Hits and misses (20 minutes)
latindex_20m <- latindex_20m_onfile %>%
select(-X10) %>% # drop spurious column
gather(key = "key", value = "voltage", -subnum) %>% # gather all columns with voltages
separate(key, into = c("region","condition","time"), extra = "merge", sep = "_") %>% # split into region (1), condition (2) and time (4). Split after underscore (but stop after splitting into 3 columns)
mutate(time = str_replace(time,"_t.+","")) %>%# remove unnecessary info after last underscore in time vector
mutate(subnum = parse_factor(subnum, levels = NULL), # make into factors for statistical analysis
condition = parse_factor(condition, levels = NULL),
time = parse_factor(time, levels = NULL))
RM ANOVA
(Intercept) |
1 |
20 |
0.862 |
4.273 |
4.035 |
0.058 |
|
0.153 |
0.168 |
time |
3 |
60 |
0.004 |
0.272 |
0.283 |
0.838 |
|
0.001 |
0.014 |
condition |
1 |
20 |
0.048 |
0.076 |
12.676 |
0.002 |
* |
0.010 |
0.388 |
time:condition |
3 |
60 |
0.004 |
0.169 |
0.465 |
0.708 |
|
0.001 |
0.023 |
|
2 |
time |
0.782 |
0.468 |
|
4 |
time:condition |
0.848 |
0.688 |
|
|
2 |
time |
0.868 |
0.810 |
|
1.009 |
0.838 |
|
4 |
time:condition |
0.893 |
0.687 |
|
1.044 |
0.708 |
|
|
- Main effect of
condition
on alpha lateralization: F(1, 20) = 12.68, p = .002, \(\eta^2_p\) = .39
time
by condition
interaction alpha lateralization: F(3, 60) = 0.46, p = .708, \(\eta^2_p\) = .02