R training

Here are the materials and preparation instructions for the training course ‘Modelling behavioural data using R‘. These sessions, which you can work through on your own if not attending them in person, give a basic introduction to working in R, and to linear statistical modelling. This should allow you to do your own basic data analysis in R, and move on to more advanced approaches as outlined for example in Richard McElreath’s Rethinking Statistical Inference (CRC Press, 2015).

Downloading and Installing R
The sessions use two applications, R and RStudio. It would be a good idea to install R and RStudio on to whatever computer you plan to work from before beginning. You need to install R before installing R Studio. You install R from: https://cran.r-project.org/ and RStudio from https://www.rstudio.com/products/rstudio/download/ (Desktop version, Open Source licence).

Session 1: Introducing R
For session 1, there is a data file called ‘weight.data.csv’, and a PDF handout. You can download these here. Save the data file somewhere convenient on your computer where you will be able to easy navigate to it, and make sure has the correct name and file extension.

Session 2: Introducing the General Linear Model
There is a PDF handout, and the same ‘weight.data.csv’ data file that we used in session 1. You can download them here.

Session 3: Plotting and interactions
For this session, there is a PDF handout, a new data file ‘star.data.csv’, and a script file ‘session3.r’. Download them here. Make sure you save the data and script files somewhere on your computer you can easily navigate to them. Before taking on this session, it would also be good to install the contributed package “ggplot2” (see session 1 handout on how to install a contributed package).

Session 4: Generalized and mixed models
Coming soon