Code for ‘Data Analysis And Graphics Using R’, 3rd edn, CUP, 2010

John Maindonald and John Braun

Oct 2, 2014

The script that follows is designed to be executed as it stands. It sets upfunctions that create Ch 5 graphs, then runs those functions. If executed byclicking on the RStudio “Compile Notebook …” command, it will be processedthrough R Markdown, generating a document that includes code, output andgraphs generated by executing the functions. If some needed packages aremissing, warning messages will appear. See further:http://rmarkdown.rstudio.com/r_notebook_format.html

## Diagnostic plots for the regression of Figure 5.1:
## Panel (A) plots residuals against fitted values.
## Panel (B) is a normal probability plot of residuals.
## If residuals follow a normal distribution the points
## should fall close to a line.