18.05 | Spring 2022 | Undergraduate

# Introduction to Probability and Statistics

## Learning and Teaching with R

In addition to the lecture slides and in-class problems, which are presented in .pdf format, each week’s materials in 18.05 Introduction to Probability and Statistics include a studio that students complete in R, a language for statistical computing and graphics. Below, Dr. Jeremy Orloff and Dr. Jennifer French Kamrin describe the advantages R offers as a learning and teaching technology.

Here are some of the things we like about R and RStudio (a free IDE for R):

1. R is one of the standard packages for statistical work across a wide variety of fields. Being exposed to R will be helpful for many of our students.
2. R and RStudio are free, are painless to install, and work smoothly on all the standard computing platforms. The graphics are completely integrated into RStudio and are easy to use for basic plots. With more experience they can make quite sophisticated plots.
3. With a few short tutorials, it is easy to get started using R productively. So learning computer programming is not a major hurdle to its use. (At this point the majority of our students have some programming background, but there are always a few students for whom it is brand new.)
4. The language allows us to ask students to first write code that mirrors how we want them to understand statistics. After that, we can show them the powerful, but more opaque tools that do this work for them.

In the first iterations of the class we used MATLAB. This is also an industry standard, but we found it much harder to teach with and there were many more technical issues we had to troubleshoot. Python is another industry standard we seriously considered. In many ways it is a much nicer language than R and can run much faster on large data sets. But it takes longer to get to a point where students can use Python productively, and it is (or at least was) harder to set up and learn to use the graphics engines associated with Python.

## Course Info

Spring 2022
##### Learning Resource Types
Lecture Notes
Problem Sets with Solutions
Exams with Solutions