Preface
0.1 A few notes on this Handbook
If you have never worked with R, I highly recommend to read through all of the Introduction to R chapter 1. Even if you have worked with R before, do take a look - you might still learn something.
If you are familiar with a little bit of R, then turn to the Data Science Chapter 2. There, you will be introduced to the tidyverse commands as well, which are sort of the “new” R commands.
The Project Management Chapter 3 will introduce you to RMarkdown and R Projects, so will make your life much easier going forward.
After that, the Introductory Exercises just introduce the commands in practice, while the Weekly Problem Set answers then tackle the statistical concepts for each week.
0.2 Fundamental Differences to Stata
- Packages are much more important - you’ll find yourself installing many more packages than you would otherwise in Stata. This means you need to do a bit more function management, but fundamentally, this opens up an immense world of applications.
- The way that R stores information is quite different to Stata!! This is probably the most important aspect! Stata normally holds a single dataset (think of a single Excel worksheet) saves information (nearly) always as a column in this dataset.1 In R, information is generally stored in an object. An object can be a collection of text (a character vector), a dataset, a list of various types etc.
- R does not, by default, use value labels.
0.4 Acknowledgments
Open-source software and teaching materials are amazing. In the spirit of open-source, the source code for this handbook is available here and I gratefully acknowledge the amazing material I have copied and modified, prepared by:
- Learning statistics with R by Danielle Navarro (especially Section 1)
- I used
bs4_book
withbs_lib
primary theme#274E82
for the design of this handbook. - Programming and Statistics can be boring at times. All the more reason to use the brilliant artwork by Allison Horst to help us understand the commands a little better. You can find all of them and more here.
- I used material from the UC Business Analytics R Programming Guide
Similarly, please feel free to use the material provided for your own purposes or reach out to me with any suggestions, how to make this material better. The souce code can be found here.