ModernDive

The ModernDive organization on GitHub

Dive into statistics through data science

ModernDive is home to an open-source textbook, tidyverse-friendly R and Python packages, and ready-to-teach datasets — everything you need to learn or teach statistical inference by working with real data.

ModernDive logo: a snorkel mask under a wave with a rising bar chart
800+GitHub stars
530+Forks
12Open repositories
2Languages: R & Python

The book

Statistical Inference via Data Science

A free, open-source textbook by Chester Ismay, Albert Y. Kim, and Arturo Valdivia that teaches statistical inference the way it is practiced: starting from real data, wrangling and visualizing it, then building up to sampling, confidence intervals, hypothesis testing, and regression.

ModernDive, Second Edition

A ModernDive into R and the Tidyverse

The current edition, fully revised and freely readable online. Built around the tidyverse, infer, and moderndive packages, with exercises and real datasets throughout — also available in print from CRC Press.

First edition

The original ModernDive, still online for courses that use it.

Open development

The book is written in the open — file issues, suggest edits, or fork it.

Software

Companion packages for R and Python

The same tidy, simulation-first approach to inference and regression, in whichever language your course runs.

RCRAN
moderndive R package hex sticker

moderndive

Tidyverse-friendly introductory linear regression: get_regression_table(), get_regression_points(), wrapper functions designed for first courses, plus all datasets used in the book.

PythonPyPI
moderndive Python package hex sticker: a python wearing a dive mask

moderndive for Python

The Python companion: a tidy simulation-based inference grammar modeled on infer, regression helpers, the book's datasets, and dual-engine plotting with plotly and plotnine.

Data packages

Real datasets, ready to teach with

Tidy, documented R data packages in the spirit of nycflights13 — current enough that students recognize the world in them.

R dataCRAN

nycflights23

All outbound flights from New York City in 2023, with weather, planes, airports, and airline metadata.

R data

nycflights22

All outbound flights from New York City in 2022 — pair with 2023 to study year-over-year change.

R data

pnwflights22

Outbound flights from Seattle and Portland in 2022, for a Pacific Northwest take on the flights data.

R data

azflights24

Outbound commercial flights from Arizona's primary airports in 2024, plus supporting metadata.

R data
olympicAthletes hex sticker

olympicAthletes

Every athlete-event in the modern Olympics, Athens 1896 through Milano-Cortina 2026 — about 315,000 rows.

R dataCRAN
steves hex sticker

steves

A tidy snapshot of every Rick Steves' Europe episode from 2000 to 2025, for teaching data analysis with a passport.

R dataCRAN
exoplanetdata hex sticker

exoplanetdata

Confirmed exoplanets and their host stars from NASA's Exoplanet Archive, tidied for the classroom.

R dataCRAN
Animated volcanoes hex sticker with an erupting volcano

volcanoes

Around 1,200 Holocene volcanoes with their eruptions and events, from the Smithsonian Global Volcanism Program.

For instructors

Teach a course with ModernDive

Labs, problem sets, and instructor resources built to pair with the book — used in intro statistics and data science courses worldwide.

Labs & course materials

Ready-to-adapt lab exercises and resources for running a ModernDive-based course, openly available.

Instructor resources

Additional instructor-only materials for ModernDive v2 are available to verified instructors — sign up to request access.