Introduction to using R for statistics
December 12, 2022
Preface
This book is intended to provide students with a resource for learning R while using it during an introductory statistics course. The first five chapters chapters are about how to get started with R, and are necessarily more to do with learning the language and syntax. With permission, they are based strongly (for large parts identical) on the STAT444 course by Derek Sonderegger which goes far beyond this course, and is an excellent resource for anyone interested in developing their R skills further.
The second part of the course covers an introduction to inference using R, and the final part is an introduction to regression.
I use parts of this book for various courses at Brunel University of London, and elsewhere.
This book covers common issues that students in a typical statistics course will encounter and provides a simple examples and does not attempt to be exhaustive.
Other Resources
There are a great number of very good online and physical resources for learning R. Hadley Wickham is the creator of many of the foundational packages we’ll use in this course and he has worked on a number of wonderful teaching resources:
Hadley Wickham and Garrett Grolemund’s free online book R for Data Science. This is a wonderful introduction to the
tidyverse
and is free. Many of the topics this book covers are perhaps better covered in Hadley and Garrett’s book. For people brand new to R, R for Data Science probably has the wrong presentation order.Julian J. Faraway’s book Linear Models with R, available e.g. at Amazon is a great resource for most of the statistical material we cover, with good examples in R.
There are a number of other good resources out there as well:
Michael Freeman’s book Programming Skills for Data Science. This book covers much of what we’ll do in this class and is quite readable.
Roger Peng also has an online book R programming for Data Science introducing