How to use this book

This book contains the core content for the module. It is designed to be read in conjunction with the practical sessions and accompanying videos.

Each numbered session has an accompanying lecture and practical session. Each section of the book additionally has a short summary of the contents of that section to help you build an overview of the material. The final sections of the book do not have accompanying taught sessions but have some brief comments to help you pull all the material together.

R code

Analyses are illustrated using R code. Each page which contains R code should be self-contained. You should be able to copy and paste each chunk of R code (using the little icon to the top-right of the code cell) into R and run all the code in that page.

A number of packages will be required. These are loaded using the library function, at the appropriate points. If you are using your local version of R you may need to install these packages. Below, you will find code to install all packages used in these notes.

# Graphics package
install.packages("ggplot2")

# Will be used for fitting some generalised models:
install.packages("VGAM")

# Contains some useful goodness-of-fit diagnostics:
install.packages("pscl")

install.packages("sandwich")