Preface

These notes were used for lectures for the course 161.251 Regression Modelling taught at Massey University by a host of different staff; the relative constant in recent years is Jonathan Godfrey who is responsible for these notes.

We use R in almost every lecture; you should be able to run the code on your own. You should follow the instructions on how to get your own installation of R and RStudio on the help using R and RStudio in 161.251 page.

The material that follows makes use of tidyverse packages. Graphs are made using a mixture of base R graphics and ggplot functions, with the choice being made on the basis of convenience. There is no sense using a lot of effort if the graph is simple and will only be seen by the analyst. More effort is warranted if the graph is likely to be enriched or used for a presentation.

Please ask for help if you don’t understand the R code being demonstrated.