2 Main data files
RT_Data_Raw.csv: PsyToolkit Data pasted into a big csv file.FULL_Data_munged.csv: RT_Data_Raw subject to1_Munge_Script.R.Wang_results.csv: Data for Figure 3.cents_and_interval_labels.txt: labels for Figure 1.
Created: 2/2/2021.
These files contains the data and analysis scripts for “Automatic Responses to Acoustically Rough Intervals” concerning the reaction time data. See also the repository related to computational_models.
All data files are available at OSF repository: https://osf.io/zmjpd/.
RT_Data_Raw.csv: PsyToolkit Data pasted into a big csv file.FULL_Data_munged.csv: RT_Data_Raw subject to 1_Munge_Script.R.Wang_results.csv: Data for Figure 3.cents_and_interval_labels.txt: labels for Figure 1.1_Munge_Script: Deletes timeouts, each participants RT data is fitted with Gamma distribution. Outliers (i.e. RTs outside 250ms<RT<95th percentile of Gamma) and incorrect answers are deleted. Note that running this script takes considerable amount of time due to bootstrapping. It can be by-passed by reading the data provided by this script (“FULL_Data_munged.csv”).2_GLMModel.R: Fits GLMM model to data, tests for significance. Two versions…inverse Gaussian or Gamma as underlying distribution: no difference to pattern of significance.3_Contrasts_Roughness_Harmonicity.R: Make sure script 2 is run first; planned contrasts for High and Low Delta_Roughness and Delta_Harmonicity.4_Correlation_Wang.R: Simple correlation test between Delta_Roughness for the expanded data to include artificial intervals. Uses raw (i.e. untransformed Wang roughness values).5_Roughness_LHE.R: Compares Low vs (High and Extreme) with Low vs High vs Extreme. [NB: as we collapse across each participant to create a priming index, we switch to simple lm rather than glmer (i.e we don’t have random effect of participant).6_Figure_1.R: creates Figure 1, needs cents_and_interval_labels.txt7_Figure_2.R: creates Figure 28_Figure_3.R: creates Figure 3, needs Wang_results.csv9_Supplementary_Wilcox_Test.R: Tests for congruency effects for each pair of intervals seperately10_KSTESTS.R: Checks that data fits Gamma distributionsSeparate repository produces the predictions by computational models (roughness and harmonicity). The model predictions are also compared to each other and to empirical data (the results past rating studies involving consonance and dissonance). The way the predictions are created (separation into High and Low deltas) are also created by the these analyses. Also, the stimulus visualisations are included in the scripts.
See computational_models.
# Only run if needed.
# source('1_Munge_Script.R')source('2_GLMModel.R')
source('3_Contrasts_Roughness_Harmonicity.R')source('4_Correlation_Wang.R')
Pearson's product-moment correlation
data: df$deltarough and df$Index
t = 2.3004, df = 377, p-value = 0.02197
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.01712277 0.21583104
sample estimates:
cor
0.1176544
source('5_Roughness_LHE.R')| Delta_R | I | SDI |
|---|---|---|
| E | 11.295217 | 40.89082 |
| H | 10.856638 | 42.30070 |
| L | -0.084045 | 46.88718 |
source('9_Supplementary_Wilcox_Test.R')[1] “Test on each interval pair for automatic responses to acoustical rough musical intervals:”
| Intervals | V.value | p.value | Cohen.s.d |
|---|---|---|---|
| m3M3 | 368 | 0.383 | 0.002 |
| m2P5 | 252 | 0.027 | 0.214 |
| m6M6 | 435 | 0.246 | 0.007 |
| M7P5 | 325 | 0.349 | 0.056 |
| ttP5 | 330 | 0.377 | 0.041 |
| m2tt | 173 | 0.002 | 0.357 |
| m2M3 | 236 | 0.041 | 0.251 |
| M2P5 | 191 | 0.056 | 0.176 |
| d2P5 | 278 | 0.137 | 0.240 |
| s2S5 | 249 | 0.040 | 0.306 |
source('10_KSTESTS.R')[1] “Fit gamma function to each participant’s RT distribution” [1] “and use Kolmogorov-Smirnow test to assess the goodness of fit”
Exact binomial test
data: failures and 379 number of successes = 11, number of trials = 379, p-value = 0.9833 alternative hypothesis: true probability of success is greater than 0.05 95 percent confidence interval: 0.01636026 1.00000000 sample estimates: probability of success 0.02902375
6_Figure_2.R: creates Figure 1, needs cents_and_interval_labels.txt.
7_Figure_2.R: creates Figure 2
8_Figure_3.R: creates Figure 3, needs Wang_results.csv
source('7_Figure_1.R')source('6_Figure_2.R')source('8_Figure_3.R')sessionInfo()R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_GB.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] ggrepel_0.8.2 Rmisc_1.5 plyr_1.8.6 lattice_0.20-41
[5] ggplot2_3.3.3 fitdistrplus_1.1-1 survival_3.2-7 lsr_0.5
[9] emmeans_1.5.1 car_3.0-10 carData_3.0-4 lmerTest_3.1-2
[13] MASS_7.3-53 dplyr_1.0.2 lme4_1.1-23 Matrix_1.2-18
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 mvtnorm_1.1-1 zoo_1.8-8
[4] digest_0.6.27 R6_2.5.0 cellranger_1.1.0
[7] evaluate_0.14 coda_0.19-4 highr_0.8
[10] pillar_1.4.7 rlang_0.4.10 curl_4.3
[13] multcomp_1.4-14 readxl_1.3.1 minqa_1.2.4
[16] data.table_1.13.6 nloptr_1.2.2.2 rmarkdown_2.6
[19] labeling_0.4.2 splines_4.0.3 statmod_1.4.34
[22] stringr_1.4.0 foreign_0.8-80 munsell_0.5.0
[25] compiler_4.0.3 numDeriv_2016.8-1.1 xfun_0.19
[28] pkgconfig_2.0.3 htmltools_0.5.0 tidyselect_1.1.0
[31] tibble_3.0.4 rio_0.5.16 codetools_0.2-16
[34] withr_2.3.0 crayon_1.3.4 grid_4.0.3
[37] nlme_3.1-149 xtable_1.8-4 gtable_0.3.0
[40] lifecycle_0.2.0 magrittr_2.0.1 scales_1.1.1
[43] zip_2.1.1 estimability_1.3 stringi_1.5.3
[46] farver_2.0.3 ellipsis_0.3.1 generics_0.1.0
[49] vctrs_0.3.6 boot_1.3-25 sandwich_3.0-0
[52] openxlsx_4.2.2 TH.data_1.0-10 tools_4.0.3
[55] forcats_0.5.0 glue_1.4.2 purrr_0.3.4
[58] hms_0.5.3 abind_1.4-5 yaml_2.2.1
[61] colorspace_2.0-0 knitr_1.30 haven_2.3.1