Dear participant, thank you for registering for this online course co-organised by the NCRM, the University of Southampton and the Durham Research Methods Centre.
Note: If any of the links below do not open, please use the right mouse button to click on the link, and then choose “Open link in new tab”. This will work.
The course will run from March 27 to March 29. The location is the Scott Logic Theatre (MCS0001) in Mathematical Sciences and Computer Science Building, close to the Botanic Garden. Directions can be found here.
We will begin each day at 10am. The precise layout is slightly different on each day, please see our Sharepoint pages for a programme. The morning session will end at 12:40pm, followed by a lunch (which we provide). The afternoon sessions finish on 5:30pm, 5pm, and 4:30pm, respectively, on Monday, Tuesday and Wednesday. There will be a catered coffee break in each of the afternoon sessions.
There will be two practical sessions each day. Some of these will be delegated to breakout rooms, for which tutors will split the audience into groups of 6-12 participants.
The course will be facilitated by Professor Jochen Einbeck, Dr Akansha Singh, Dr Nasima Akhter, Dr Bilal Ashraf, and Germaine Uwimpuhwe, from the Research Methods Centre at Durham University. Support by Janelle Wagnild, Dimitris Vallis, and Ehsan Karatikoopaei in producing the material, and by Yingjuan Zhang in the delivery of lab sessions, is acknowledged.
In terms of content, the three days are roughly organized as follows:
We will use the statstical programming language R for this course. R is free open source software (GPL-2 | GPL-3) and can be downloaded from CRAN. The best way of using R is through the Integrated Desktop Environment RStudio, which can be downloaded for free and from rstudio.com. Rstudio has recently been rebranded to Posit but it is the same product. A video with some instructions on downloading, and installing, and getting started with, R and RStudio can be found here.
Please bring a laptop with you and make sure you have functioning versions of R and RStudio installed. If you already have R and RStudio installed on your laptop, it is recommended to upgrade to versions 4.2.0 and 2021.09.0, respectively, or newer.
If you prefer not to install R and RStudio, or if you are using a chromebook etc and are not able to easily install software, another option is to create a free account under R Studio Cloud, now Posit Cloud (Note: This is a commercial cloud-based system for which neither the NCRM, nor Durham University nor the University of Southampton will offer any support nor accept any liability). Please ensure before the start of the course that your R system works.
The most important R package will be lme4 which you can install via
install.packages("lme4")
You can then load the package via
library("lme4")
## Loading required package: Matrix
To check whether this has worked, you may execute
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
summary(fm1)
This will give you some output – you will understand later in this course what it means!
You need to do the installation only once, but you need to load the package everytime again that you open R.
Other R packages which will (or may) be needed during the labs are nlme, ggplot2, tidyverse, haven, eefanalytics, glmer, glmmTMB, lmerTest, sjPlot, and performance.
(It is noted that the labs can in principle also be worked through in STATA, but the support that we give for this is limited and may depend on the expertise of the tutors who are available on that day.)
This document is produced through an R Notebook based on R Markdown. R Markdown documents can contain a mixture of text and R code (such as this document), and they have a .Rmd
ending.
In R Studio, R Markdown documents can be “knitted” (i.e. compiled into a document) by clicking on the “Knit” or “Preview” button in the top menu bar. Several choices are then possible, including “Knit to PDF” or “Knit to HTML”. In this case, we have used “Knit to HTML”. In rare occasions you may need to install R packages knitr and rmarkdown before this works.
All lab sheets produced for this course are knitted Markdown scripts. Beside the PDF version, we will also provide you with the .Rmd
version, so that, if you like, you can work directly with the Notebook in the labs. However, if you prefer, you can also just type your work into a plain R script (with .R
ending).
Either way, in order to create a new file, you choose in the RStudio menu File
–> New File
, and then either R Script
(to produce a .R
file) R Notebook
(to produce a .R
file).
The .Rmd
version of this document, along with all other material relating to this course, can be assessed through our NCRM course repository. (Depending on browser/configuration, the repository may look “empty” when you open it firstly. If so, please use the Previous
and Next
buttons at the top right of the page to navigate between the different items. There will then appear folders which contain the material for the individual days. If you just see a blank screen, refreshing the page might also help. Currently these folders are still empty though! Material will be filled in a few days before the start of the course).
Important: For your access to the Sharepoint area to work, we will need to give you shared access which we will do via the e-mail address that you have used for registration. If, for any reason, you need to have this sent to a different e-mail address to the one that you have originally registered with, please let us know the e-mail address that we shall use.
There is no preliminary reading required. However, if you have very little or no experience with R, a useful guide is the monograph
Discovering Statistics Using R, by Andy Field, Jeremy Miles and Zoë Field
For the purposes of this course, especially Section 3.4, 3.5, 3.9, 4.4, 4.5, and 7.4, 7.5, 7.8 are relevant (The book is not actually using RStudio, but rather the “R Commander” functionality within the plain R installation, but the shown R code is applicable either way.)
Another useful resource are the “Oxford R Lectures” which are also used by Academy for PhD Training in Statistics (APTS) as preliminary material for their training courses.