RMDL – Week 6

Varying effects II

1 Introduction

Warning

When working through these tutorials, make sure you are in the course Quarto Project you created.

You know you are in a Quarto Project because you can see the name of the Project in the top-right corner of RStudio, next to the light-blue cube icon.

If you see Project (none) in the top-right corner, that means you are not in a Quarto Project.

To make sure you are in the Quarto project, you can open the project by going to the project folder in File Explorer (Win) or Finder (macOS) and double click on the .Rproj file.

In this tutorial you will run a Bayesian model with the data from Martin 2020 (DOI 10.1177/0956797620931108). You can get the data by downloading the zip file with all the data from this course. The Martin 2020 data is in martin2020/data_anonymized. The file martin2020/data_anonymized/README.txt contains information on the columns found in the data. You will have to bind the English and Kîîtharaka data.

Filter the data to have only “post-pre” trials (trial_type) and address the following research question:

Do both English and Kîîtharaka show a preference for post-changed items (i.e. greater accuracy) in both conditions (words and shapes)?

Does the model converge (or did you get a warning about divergent transitions, convergence, ESS being too low)? If it did not converge, the warning includes the following suggestions, related to the MCMC algorithm:

  • Increase the number of iterations (2000 by default): for example, iter = 4000.
  • Increase adapt_delta (number between 0 and 1, 0.8 by default): for example, control = list(adapt_delta = 0.9999).
  • Increase max_treedepth (10 by default): for example, control = list(max_treedepth = 15).
  • Specify more informative priors. You might have not covered priors in QML, but if you did, you can specify weakly informative priors (the default prior are uninformative).