Playground

Practise every chapter on the student wellbeing data

The playground is where you practise. Every chapter of the book has a playground page, and every page works through the chapter in four parts. Practise the chapter repeats the book’s exercises, with starter code, hints, and solutions. Go further goes beyond the book, with new questions, simulations, and some of R’s built-in datasets. Check your understanding asks short questions whose model answers open with a click. Do it yourself ends each page with open tasks and no answers: an empty space for your own code, as in your own thesis.

You can do the exercises in two ways. In your browser, you type and run R code on the page itself, without installing anything. On your own computer, you download the chapter’s project and open it in RStudio: it contains the data and all four parts as an R script, with the solutions in a separate file. A few packages used in the later chapters, such as tidymodels, mclust, and fable, are too large for a browser. On those pages, the browser exercises teach the same ideas with functions that come with R, and the download project uses the chapter’s own packages.

Try each exercise yourself before you open the hint or the solution. Making mistakes and fixing them is how everyone learns R.

Chapter Playground
1 Getting Started with R
2 Data Structures in R
3 Data Manipulation
4 Data Visualization
5 From Research Question to Data
6 Descriptive Statistics and EDA
7 Hypothesis Testing and Statistical Inference
8 ANOVA and Regression
9 Multivariate Statistical Methods
10 Mixed-Effects Models
11 Introduction to Machine Learning in R
12 Classification Models
13 Predictive Regression
14 Advanced Clustering
15 Neural Networks
16 Time Series Forecasting
17 Reproducible Research
18 Using AI with R
19 Putting It All Together

Please note: the case study and its data are fictional: the data was generated by a computer program to look realistic, and its patterns were built in by the author. It describes no real people and is not evidence about real students; do not cite or use it as research findings.