1 Overview

In this session, we will take a look at how we can use R to generate data to create questions. The first example will work through question 1 of Paper 1 from the 2021 exam. You can access the paper and solutions by clicking on the links. The second example will introduce how to generate data for a simple linear model.

1.1 Libraries

Throughout this tutorial, we will use some libraries within R. If you are logged into a University computer, please load the following libraries:

If you would prefer to work through the examples on your own device, you will need to install the following libraries:

  • tidyverse
  • truncnorm
  • gridExtra
  • BSDA
  • ggfortify