StatLab is a complete R and statistics course that runs entirely in the browser.
Students read, predict, write real R, and get instant feedback, from their first read.csv to mixed models and Bayes.
No installation. No account. No server. No data ever leaves the student's computer.
Built for psychology and business students at the University of Twente.
Made by dr. P.J.H. Slijkhuis and dr. V.d.C. Resendez Gomez, based on materials provided by dr. S.J. Watson. Theory, terminology and topic order follow Analysing Data Using Linear Models by S.M. van den Berg (5th ed., University of Twente, 2021; Creative Commons BY-NC-SA licence); the lessons are written independently.
| The full R language, compiled to WebAssembly with webR, runs in the page. Open a link on any laptop or Chromebook and start coding in seconds. | 89 exercises are marked by R itself. A wrong answer gets feedback on the specific mistake, not just a red cross. | Students design their own avatar, which explains their mistakes and R's error messages in plain language. |
| Every solved exercise and finished lesson earns points to spend in the avatar shop. Daily streaks keep students coming back. | Drag a regression line, draw a thousand samples, watch p-values move. The hardest ideas in the course become something you can play with. | A guide that walks from a research question to the right model among 45, with ready-to-run R code and a link to the lesson. |
Script tabs, console, environment and files panes, Tab completion, and most of CRAN one install.packages() away.
|
Upload a CSV or Excel file and analyse it right next to the lesson. It stays in the browser and is never uploaded anywhere. | The layout folds down for small screens, and progress can be exported and picked up on another device. |
| A step-by-step sample size planner for two groups, repeated measures, 2 × 2 designs, regression and proportions, with the course model to fit, a power curve and R code that reproduces it. | Type what you are looking for, "compare two groups" or "how many people do I need", and the avatar points to the right lesson or tool. | Keyboard navigation, a skip link and screen reader labels, with every page scanned against WCAG 2.1 AA on each change. |
On a phone the sidebar folds into a Lessons button and the streak, points and progress tiles stack into a grid. Progress, streaks, points and the avatar all live in the browser, and export to a file that imports on any other computer.
18 modules · 64 lessons · 89 checked exercises · 6 interactive simulations.
From "what is a file path?" to mixed models, logistic regression, mediation and
Bayes. Statistics is taught the way the course team's own R workshops teach it:
in tidyverse style and through the linear model. lm, lmer and glm do the
work, and the t-test, ANOVA and chi-square appear as those same models under
their traditional names.
| Module | What it covers | Simulation | |
|---|---|---|---|
| Foundations | |||
| 0 | Before you start | RStudio Projects, files, folders and paths, and what R's symbols mean, with a cheat sheet | |
| 1 | First steps in R | Objects, functions, help, packages and library() |
|
| 2 | Working with data | read.csv, factors, the pipe, select, filter, mutate, wide and long data |
|
| 3 | Describing data | group_by and summarise, mean versus median, surprises in a summary, scale scores and Cronbach's alpha |
|
| 4 | Visualising data | ggplot2 as layers, facets, and an APA-ready figure | |
| Inference | |||
| 5 | The normal distribution | Density, z-scores and probabilities | Distribution |
| 6 | Sampling | Sampling error, sampling distributions, the Central Limit Theorem | Central Limit Theorem |
| 7 | Estimation | Standard errors, confidence intervals, SD, SE and CI error bars | Confidence intervals |
| 8 | Hypothesis testing | Null distributions, p-values, Type I and II errors, power, effect sizes and sample-size planning | p-values and power |
| 9 | Counts and proportions | One proportion, contingency tables, the chi-square test, Cramér's V, Fisher's exact test | |
| The linear model | |||
| 10 | Correlation and simple regression | lm(y ~ x), reading model output with tidy() and glance(), Spearman and Kendall rank correlations |
Correlation, least squares |
| 11 | Multiple regression | Several predictors, each slope holding the others constant, reporting R² and F, checking residuals and influential cases, Simpson's paradox | |
| 12 | Categorical predictors | The t-test as lm, dummy coding, emmeans pairwise comparisons, the Kruskal-Wallis test |
|
| 13 | Interactions and factorial designs | a * b, sum-to-zero contrasts, Type III tests with car, interaction plots |
|
| 14 | Repeated measures and nested data | lmer with (1 | id), fixed and random effects, the paired t-test, group by time designs, pre, mid and post, Wilcoxon and Friedman tests |
|
| 15 | Binary and count outcomes | glm(..., family = binomial), log odds, odds ratios and reporting, Poisson regression for counts |
|
| Advanced | |||
| 16 | Bayesian statistics | Prior, likelihood and posterior, credible intervals, Bayes factors, Bayesian regression | |
| 17 | Mediation, factors and reports | Indirect effects with bootstrap intervals, exploratory factor analysis, reproducible reports with Quarto |
Every lesson is built from the same few blocks, so learning is active from the first line:
- 🤔 Predict: commit to an answer before the code or simulation settles it.
▶️ CodeBlock: an editable R editor with console output, warnings, errors and plots.- 🎯 Exercise: a task whose answer R checks, with hints and a solution.
- ❓ Quiz: a conceptual question with an explanation for every choice.
- 📝 Interpret: pick the right reading of the output and the right APA-style sentence.
- 🎛️ Simulation: one of the six interactive simulations.
Two fictional, generated datasets carry the course: a population of 5000
students (wellbeing-population.csv) for the sampling modules, and a workplace
study of 480 employees (workplace.csv) built so that the models in the
linear-model part have real effects to find, and one deliberate null (mentoring
on wellbeing).
- Every exercise is tested against real R. On every change, CI runs each solution, alternate solution and known wrong answer through R and checks that the right ones pass and the wrong ones fail for the right reason.
- A real browser clicks through the site before anything is published.
- Accessible by default. Every page is scanned with axe against WCAG 2.1 AA on each change, and a failing scan blocks the release.
- It keeps itself up to date. A weekly workflow checks for new versions of webR and the site's dependencies and only takes them after the full R check passes.
- Private by design. A static site with no backend, no accounts and no tracking. Uploaded data and progress never leave the student's browser. The only outside requests are the browser downloading webR and R packages from r-wasm.org.
StatLab was made by dr. P.J.H. Slijkhuis and dr. V.d.C. Resendez Gomez, based on materials provided by dr. S.J. Watson. Theory, terminology and topic order follow Analysing Data Using Linear Models by Prof. dr. Stéphanie M. van den Berg (5th edition, University of Twente, 2021), which is licensed under a Creative Commons BY-NC-SA licence. StatLab's lessons follow its theory, terminology and topic order but are written independently.
RStudio is a trademark of Posit Software, PBC. StatLab is not affiliated with or endorsed by Posit.
StatLab (lessons, exercises, datasets and code) is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0, the same licence as the textbook it follows. You may share and adapt it for non-commercial use if you credit the authors and share your version under the same licence. The University of Twente and BMS Lab logos belong to their owners and are not covered by this licence. Third-party packages keep their own licences.
It is a project of the University of Twente and
The BMS Lab. The same credit shows at the foot of
the sidebar on every page of the site and at the bottom of the home page. The
partner logos are in src/assets/logos/, picked up by file name;
see the README there to replace one.













