Computerised Adaptive Beat Alignment Test (CA-BAT)

DOI R-CMD-check

Try the CA-BAT here!

The CA-BAT is an adaptive test of beat perception ability. We invite you to try the test here, and to read the paper here.

Want to use this test in your own online study, but don't want to go to the trouble of setting up your own web server? You are invited to host your study on the DOTS testing server of the German Society for Music Psychology (DGM). This service is free of charge, but requires a current membership of the GDM, which currently costs 45 euros per year (22 euros for students and the unemployed). For more information please contact Klaus Frieler (


When using the CA-BAT in your own research, you can cite the original CA-BAT research paper:

Harrison, P. M. C., & Müllensiefen, D. (2018). Development and validation of the Computerised Adaptive Beat Alignment Test (CA-BAT). Scientific Reports, 8(12395), 1–19.

and this implementation:

Harrison, P. M. C., & Müllensiefen, D. (2018). Computerised Adaptive Beat Alignment Test (CA-BAT), psychTestR implementation. Zenodo.

We also advise mentioning the software versions you used, in particular the versions of the cabat, psychTestR, and psychTestRCAT packages. You can find these version numbers from R by running the following commands:

if (!require(devtools)) install.packages("devtools")
x <- devtools::session_info()
x$packages[x$packages$package %in% c("cabat", "psychTestR", "psychTestRCAT"), ]


We are grateful to the following individuals for translating the CA-BAT into new languages:

Installation instructions (local use)

  1. If you don't have R installed, install it from here:

  2. Open R.

  3. Install the ‘devtools’ package with the following command:


  1. Install the CA-BAT:



Quick demo

You can demo the melodic discrimination test at the R console, as follows:

# Load the cabat package

# Run a demo test, with feedback as you progress through the test,
# and not saving your data

# Run a demo test, skipping the training phase, and only asking 5 questions
demo_cabat(num_items = 5, take_training = FALSE)

Testing a participant

The standalone_cabat() function is designed for real data collection. In particular, the participant doesn't receive feedback during this version.

# Load the cabat package

# Run the test as if for a participant, using default settings,
# saving data, and with a custom admin password
standalone_cabat(admin_password = "put-your-password-here")

You will need to enter a participant ID for each participant. This will be stored along with their results.

Each time you test a new participant, rerun the standalone_cabat() function, and a new participation session will begin.

You can retrieve your data by starting up a participation session, entering the admin panel using your admin password, and downloading your data. For more details on the psychTestR interface, see

The CA-BAT currently supports English (EN), French (FR), German (DE), Russian (RU), Spanish (ES), Latvian (LV), and Italian (IT). If you would like to add a new language to this list, please contact us. You can select one of these languages by passing a language code as an argument to standalone_cabat(), e.g. standalone_cabat(languages = "DE"), or alternatively by passing it as a URL parameter to the test browser, eg. (note that the p_id argument must be empty). Please note that the demo version of the test (demo_cabat) currently only supports English.


The main output from the CA-BAT is an ability score, corresponding to the ability estimate for the participant. It is computed from the underlying item response model and ranges approximately from -4 to +4. A secondary output is an ability_sem score, corresponding to the standard error of measurement for the ability estimate; again, it is computed from the underlying IRT model. For most applications you would only use the ability value, unless using a statistical analysis technique that allows you to specify measurement error explicitly. For more information about item response theory, see the Wikipedia article; for more information about CA-BAT scores, see Harrison & Müllensiefen, 2018.

psychTestR provides several ways of retrieving test results (see Most are accessed through the test's admin panel.

x <- readRDS("output/results/id=1&p_id=german_test&save_id=1&pilot=false&complete=true.rds")
attr(x$BAT$ability, "metadata")

Installation instructions (Shiny Server)

  1. Complete the installation instructions described under 'Local use'.
  2. If not already installed, install Shiny Server Open Source:
  3. Navigate to the Shiny Server app directory.

cd /srv/shiny-server

  1. Make a folder to contain your new Shiny app. The name of this folder will correspond to the URL.

sudo mkdir cabat

  1. Make a text file in this folder called app.R specifying the R code to run the app.

  2. To open the text editor: sudo nano cabat/app.R

  3. Write the following in the text file:
standalone_cabat(admin_password = "put-your-password-here")

sudo chown -R shiny cabat

where shiny is the username for the Shiny process user (this is the usual default).

  1. Navigate to your new shiny app, with a URL that looks like this:

Usage notes

Implementation notes

Versions <= 0.3.0 of this package experimented with weighted likelihood ability estimation for item selection. However, current versions of the package revert to Bayes modal ability estimation for item selection, for consistency with the original CA-BAT paper.

Adding new languages

See data-raw/dict-spanish.csv for an example of a foreign-language dictionary. Create a new dictionary for your new language following this format. Prepare a merge request for submitting your changes, perhaps using a fork of the original repository. Place the file in data-raw. Update data-raw/cabat-dict.R, adding a new four-line section for your new language, following the lines used to add previous languages. Run the file and commit the changes to Git. Update the cabat_languages function in languages.R to include the new language. Update the languages section in to credit the translator. Rebuild the R package locally and test that you can use the test with your new translations. Submit your changes as a merge request.

pmcharrison/cabat documentation built on July 30, 2023, 12:22 a.m.