Instructor Guide

Using Exploring Statistics with R

A guide to adopting, distributing, teaching, and adapting the R workbook.

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.

How To Navigate This Workbook

The workbook is available in HTML, PDF, and Word. Each format contains the same instructional substance, so instructors may choose the version that best fits their course.

Students need the student starter files regardless of which workbook format they use. Distribute this ZIP file before students begin, and ask them to extract the entire folder rather than opening files from inside the ZIP.

  • HTML is the most convenient teaching edition. It includes sidebar navigation, search, code-copy controls, and links to the codebook and reference pages.

    You can access it here: https://axxe.netlify.app/exploring-statistics-r/

  • PDF combines the complete workbook into one fixed-layout document with a table of contents and PDF bookmarks. It is useful for printing, archiving, or distributing one file.

  • Word provides one editable file for each start page, chapter, reference page, and the instructor guide. Use the Word files when you want to alter the workbook, add course-specific directions, adjust pacing, or distribute selected chapters through a learning-management system.

Internal website links are removed from the Word edition because a link tied to a website folder may fail after an individual document is downloaded or moved. External links, including the starter-file download, remain active.

What Students Need

Students need:

  1. a computer on which they can install or access R and RStudio;
  2. the complete, unzipped student starter folder;
  3. the workbook in HTML, PDF, or Word; and
  4. 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:

  1. open exploring-statistics-r.Rproj;
  2. open scripts/00-open-and-check-data.R from the Files tab in RStudio;
  3. run that script one section at a time; and
  4. 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.Rproj and 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 tidyverse and PMCMRplus.

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.