Instructor Guide
Using Exploring Statistics with R
Exploring Statistics with R, prepared by Erick Axxe, is an R companion to Exploring Statistics: Tales of Distributions. It follows the textbook’s research questions and statistical sequence while replacing menu-based software instructions with guided R and RStudio activities.
The workbook is written for introductory statistics students, including students who have never programmed. It teaches the R skills needed for the analyses, but it is not intended to be a complete programming course.
What Students Need
Students need:
- a computer on which they can install or access R and RStudio;
- the complete, unzipped student starter folder;
- the workbook in HTML, PDF, or Word; and
- permission to install the required R packages if those packages are not already available.
The Set Up RStudio page provides installation, download, and unzip directions. Students should begin every work session by opening exploring-statistics-r.Rproj, not by opening a script alone. Opening the project gives R a consistent starting location for the data and scripts.
Use The Student Starter Files
The student archive contains:
exploring-statistics-r.Rproj, which opens the project;data/EAMMi2-REDUCED.csv, the reduced teaching dataset;scripts/_setup.R, which prepares packages, data, graph styling, and helper functions;scripts/00-open-and-check-data.R, the first-run check;- one annotated R script for each workbook chapter; and
resources/EAMMI2_Survey_withcodes.pdf, the survey and coding documentation.
Ask students to extract the entire ZIP archive and keep its folders together. They should then:
- open
exploring-statistics-r.Rproj; - open
scripts/00-open-and-check-data.Rfrom the Files tab in RStudio; - run that script one section at a time; and
- open the script named in each assigned chapter.
The first run may take several minutes while R installs any missing packages. Later sessions should start more quickly.
Follow The Chapter Structure
Most chapters begin with one or more research questions from the textbook. A worked question typically moves through preparation, analysis, investigation of the output, and interpretation. Practice questions gradually ask students to reuse familiar code with less guidance.
Every chapter ends with Check Your Work. Instructors can ask students to delay that section until they have run the analysis and written their own interpretation. Sample responses demonstrate an acceptable answer, but another answer may also be defensible when a prompt asks students to describe a graph or explain a data decision.
The chapters deliberately reduce support over time. Early chapters explain file navigation and each major part of a command. Later chapters expect students to copy a familiar pattern, change object or variable names, check the resulting output, and describe the statistics in context. The R Command Index shows where each command is first explained.
R Packages And Supplied Helpers
The workbook uses tidyverse for data preparation, summaries, and graphs. Chapter 15 also uses PMCMRplus for Dwass-Steel-Critchlow-Fligner post hoc comparisons after a Kruskal-Wallis test. The setup script installs missing packages and loads them; students do not need separate package-management instructions.
The setup script also supplies small helper functions so students can focus on the statistical idea without repeatedly reconstructing a long calculation. These helpers:
- calculate the statistical mode and sample skewness;
- calculate Cohen’s d for one-sample, independent-group, repeated, and Tukey comparisons;
- calculate eta-squared measures for analysis of variance;
- calculate rank-biserial correlations and epsilon squared for nonparametric tests;
- calculate Cramer’s V; and
- organize selected repeated-measures and two-way ANOVA results.
The R Command Index labels supplied helpers and identifies the chapter in which each is introduced. Instructors may show the definitions in scripts/_setup.R when a class would benefit from seeing how a calculation is assembled.
Troubleshoot Common Problems
When a student reports an error, ask for the script name, the exact section run, and the first complete error message. Common fixes include:
- Open
exploring-statistics-r.Rprojand keep the starter folders together. - Run
source("scripts/_setup.R")before chapter code. - If the Console shows
+, press Esc and look for a missing parenthesis or quotation mark. - If an object is missing, rerun the section that creates it before running later code.
- If output differs from the workbook, restart R and run the chapter script from the beginning in order.
- On institution-managed computers, ask technical support to preinstall
tidyverseandPMCMRplus.
The student-facing Troubleshooting page provides a longer plain-language guide.
Data And Documentation
The EAMMi2 project is available through the Open Science Framework study page, and the survey with variable codes is included in the student starter files. The project record identifies the study materials with a CC0 1.0 license. The workbook uses a reduced teaching copy containing only the variables needed for its analyses.