The following files are included:
- `volume_SDT.R`: Calculate the volume of the polytopes representing the Block-Marschak inequalities. Also contains the code for the creating the matrix representing the Block-Marschak inequalities for the Swets (1959) data in which 5-AFC and 7-AFC are missing.
- `statpower.R`: Calculate power of test for Block-Marschack inequalities with and without the monotonic-likelihood constraints.
- `independence.R`: Calculate power for the multiplicative inequalities.
- `swets_analysis.R`: Reanalysis of Swets (1959) data. Create corresponding figure.
- `fig_rank_ROC_reanalysis.R`: yes-no ROC reconstruction using ranking and "answer-until-correct" data from Kellen and Klauer (2014), McAdoo and Gronlund (2016), and Chechile et al. (2012).
- `analysis_exp1.R` to `analysis_exp4.R`: Analysis of the experiments 1 to 4. Requires the data in folder `data`.
- `vertex_representations.pdf`: Contains the vertex representations of the Block-Marschak inequalities (as applied to $m$-AFC recognition) and the Block-Marschak inequalities together with monotonic likelihood.
- `example_violations_BMI.R`: Contains the code that produces the two example sets of choice probabilities that violate the BMIs given in section "The Testability of the Block-Marschak Inequalities in Recognition Memory".
- `asymmetry_examples.R`: Code that produces predictions for the Gaussian and double-exponential model in $m$-AFC and $m^*$-AFC task reported in section "Step 4: ROC Symmetry".
To run the code, `R` is required with the following packages:
- [`quadprogpp`](https://github.com/fnoorian/quadprogpp): For fitting the Block-Marschack and the other inequalities, we need a function that solves quadratic equations with inequality constraints. `R` offers several such packages, see section 'Quadratic Optimization' on:
https://cran.r-project.org/view=Optimization
Initially, we used the most popular package, [`quadprog`](https://cran.r-project.org/package=quadprog) for this purpose. However, in some cases the function got stuck. Consequently, we tried other packages. For example, we observed good, albeit slow, results with [`Dykstra`](https://cran.r-project.org/package=Dykstra). So all results reported here should replicate with `Dykstra` as well. We finally settled on `quadprogpp` which
is a new and fast implementation of `quadprog`, which currently is only available from [github](https://github.com/fnoorian/quadprogpp).
It requires a C++ compiler (e.g., Rtools on Windows or Xtools on Mac) and can then be installed via `devtools`. The `tar.gz` of `quadprogpp` which we used can be found in folder `packages`
- [`tidyverse`](https://cran.r-project.org/package=tidyverse): Needed for the analysis of the experiments.
- [`jsonlite`](https://cran.r-project.org/package=jsonlite): For loading in the data of the experiments.
- [`MPTinR`](https://cran.r-project.org/package=MPTinR): For analysis of experiments 3 and 4.
We have successfully executed the code with the following setup:
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 19
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_CH.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_CH.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2.2 MPTinR_1.11.0 quadprogpp_1.1-0 Rcpp_0.12.18
[5] jsonlite_1.5 forcats_0.3.0 stringr_1.3.1 dplyr_0.7.6
[9] purrr_0.2.5 readr_1.1.1 tidyr_0.8.1 tibble_1.4.2
[13] ggplot2_3.0.0 tidyverse_1.2.1
loaded via a namespace (and not attached):
[1] cellranger_1.1.0 pillar_1.3.0 compiler_3.5.1 plyr_1.8.4
[5] bindr_0.1.1 prettyunits_1.0.2 progress_1.2.0 tools_3.5.1
[9] lubridate_1.7.4 nlme_3.1-137 gtable_0.2.0 lattice_0.20-35
[13] pkgconfig_2.0.2 rlang_0.2.2 cli_1.0.0.9002 rstudioapi_0.7
[17] yaml_2.2.0 haven_1.1.2 withr_2.1.2 xml2_1.2.0
[21] httr_1.3.1 hms_0.4.2 grid_3.5.1 tidyselect_0.2.4
[25] glue_1.3.0 R6_2.2.2 fansi_0.3.0 readxl_1.1.0
[29] selectr_0.4-1 modelr_0.1.2 magrittr_1.5 backports_1.1.2
[33] scales_1.0.0 rvest_0.3.2 assertthat_0.2.0 colorspace_1.3-2
[37] numDeriv_2016.8-1 Brobdingnag_1.2-6 utf8_1.1.4 stringi_1.2.4
[41] lazyeval_0.2.1 munsell_0.5.0 broom_0.5.0 crayon_1.3.4