Labs
The course’s simulation strand
What the labs are for
Statistical inference is easier to trust once you have watched it happen many times over, not just once. The five labs in this course are the simulation strand: a thread of R-based exercises that runs alongside the week notes, giving you a place to see sampling variability, likelihood, resampling, randomization, and Bayesian updating play out computationally, over and over, rather than in a single static example.
The labs support the reasoning you build in the notes — they do not replace it. A note develops the concept, the notation, and the worked examples by hand; the matching lab lets you re-derive the same idea by simulation, so you can compare “what the formula says” against “what actually happens across many simulated samples.” Neither one stands alone. If a lab result and a note’s formula-based result disagree by more than simulation noise should allow, that mismatch is itself worth noticing and asking about.
The five labs
| Lab | Companion week | What it simulates |
|---|---|---|
| Lab 2 — Simulating sampling distributions | Week 2 | Sampling distributions: repeatedly draw samples from a known world and watch the sample mean’s own distribution take shape. |
| Lab 6 — Likelihood curves | Week 6 | Likelihood curves: compute and plot the likelihood function across candidate parameter values to see the maximum emerge. |
| Lab 10 — Bootstrap intervals | Week 10 | Bootstrap intervals: resample the data in hand, with replacement, to build a confidence interval without assuming a known standard error. |
| Lab 11 — Randomization tests | Week 11 | Randomization tests: shuffle group labels to build a null distribution for a group difference from scratch. |
| Lab 12 — Simulating the posterior | Week 12 | Posterior distributions: simulate draws from a Beta posterior to see Bayesian updating as a distribution, not just a formula. |
These five topics are named directly in the syllabus’s “Inference labs” line; the lab numbers match the week each one pairs with, and no other week has a companion lab.
A note on the code
Every R chunk you see in a lab on this site is shown for study, not executed on this site. The chunks are base R, each carries set.seed(35103) wherever randomness is involved, and each is written to be reproducible line-for-line if you copy it into your own R or RStudio/Posit Cloud session. Reading the code and predicting what it will do before you run it is itself part of the exercise.
Public vs. graded
The graded deliverable, its rubric, and due date live in Blackboard (the LMS) — this page is study and practice only.