Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

A companion to Statistics in the Modern World at CSU Bakersfield.

1Who this book is for

You have never written a line of code. That is completely normal, and this book assumes exactly that. Maybe you are a business major, a nursing major, a kinesiology major, or you just needed a GE math course that fit your schedule — the statistics is the point of MATH 1209, not the software. This little book exists because your instructor wants to show you the same statistics you’re learning by hand and by calculator, running in a free, real tool that people use in jobs after college.

2How to use this book

The 12 lessons build on each other, so read them roughly in order the first time — after that, treat it like a reference and jump straight to the lesson you need.

#LessonWhat you’ll be able to do
1What is R, and why use it?Explain what R is and why this course uses it
2Installing R & RStudio, and CSUB JupyterHubGet R running on your own computer, or skip installing anything
3Running R: notebooks, the console, scriptsPick the right way to run a line of R for the situation you’re in
4R basics: objects, vectors, functions, helpStore values, build a list of numbers, call a function, read an error
5Packages: install & library; our toolkitTurn on the mosaic and BSDA tools this course uses
6Importing dataLoad a built-in dataset, a CSV file, or data from the internet
7Exploring data (EDA) in RSummarize and visualize data with favstats(), tally(), and gf_ plots
8Probability & the Normal modelFind Normal and binomial probabilities and simulate chance in R
9Confidence intervals & testsRun and read the output of prop.test(), t.test(), and the summary tests
10Making good graphsBuild clear, colorblind-safe, accessible graphs and write good alt text
11Reproducibility & good habitsWrite scripts that run start-to-finish and reproduce with set.seed()
12Fixing common errorsRecognize and fix the most common R error messages

Each lesson follows the same shape: a plain-language idea, small examples you can copy and run yourself, and real R output — every result printed in this book was actually run in R, not typed in by hand, so what you see here is what you’ll see on your own screen.

3What you need

4The voice of this book

Short sentences. Every new word explained the moment it shows up. Lots of tiny examples instead of one long one. If a line of code in this book produces output, that output is shown right underneath it, exactly as R printed it.

This is a free, openly licensed book (CC BY-SA 4.0 for the text; MIT for the code examples). You never have to buy anything to use it.