1. Home
  2. Explore
  3. Statistics
  4. Teaching Statistics with Simulation-Based Inference

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Teaching Statistics with Simulation-Based Inference

Simulation-Based Inference in Introductory Statistics

Why teach statistics through simulation?

A traditional introductory statistics course often moves from descriptive statistics to probability and sampling distributions, and only later to inference. This sequence can make statistics feel like disconnected topics: students may enjoy exploring real data at first, then become discouraged when the course turns to abstract probability, formulas, and procedures. They may learn rules for carrying out tests without understanding what the results mean or how statistical reasoning supports conclusions.

Simulation-based inference (SBI) offers a way to keep students connected to data while they learn inference. Instead of beginning with mathematical formulas for theoretical distributions, students use repeated simulations to see what results could plausibly occur under a chance explanation. This lets them build an intuitive understanding of statistical evidence before introducing more formal terminology and theory.

SBI supports several broader teaching goals:

  • Teach statistics as a cohesive investigative process, rather than as a collection of separate techniques.

  • Introduce key ideas early and revisit them throughout a course, a strategy known as spiraling.

  • Prioritize conceptual understanding over memorizing algorithms and technical rules.

  • Reduce mathematical overhead when it is not needed to understand the statistical idea.

  • Keep students close to the data by building empirical distributions based on the study at hand.

  • Develop multivariable thinking and encourage students to interpret studies in context.

Simulation is not intended to eliminate mathematical theory or standard methods. Rather, it provides an accessible foundation for understanding why inference works and what its conclusions mean.


The three-S strategy for inference

A central framework for simulation-based inference is the three-S strategy:

  1. Statistic: Calculate a statistic from the observed data. The statistic summarizes the feature of the data relevant to the research question.

  2. Simulate: Specify a model representing a chance explanation, then simulate data under that model. The simulation should reflect the study design and the assumption being investigated.

  3. Strength of evidence: Compare the observed statistic with the simulated results. Results that would be unusual under the chance model provide evidence against that explanation.

The statistic depends on the research question and type of data. It might be a sample proportion, a difference between group means, a regression slope, or another measure of association.

Repeated simulation creates an empirical null distribution: a distribution of statistic values expected if the chance explanation were true. The observed statistic can then be judged against this distribution. If values as extreme as the observed statistic rarely appear in the simulations, the data provide evidence against the chance explanation.

The proportion of simulations that produce a result at least as extreme as the observed result provides an estimated P-value. A P-value describes how unusual the observed result would be under the null model; it does not measure the probability that the null hypothesis is true.

The three-S strategy connects many inference procedures: identify what to measure, model what chance alone could produce, and assess how surprising the observed result is under that model.


A six-step statistical investigation

Statistical inference fits within a broader process for investigating questions with data. The six steps are:

  1. Ask a research question. State what the investigation is trying to learn.

  2. Design a study and collect data. Determine how observations will be obtained and what features of the design matter for interpreting the results.

  3. Explore the data. Use summaries and visualizations to understand distributions, patterns, differences, and possible irregularities.

  4. Draw inferences. Use the data and an appropriate model to assess uncertainty and evidence.

  5. Formulate conclusions. Answer the research question in context, explaining what the evidence does and does not support.

  6. Look back and ahead. Consider limitations, assumptions, and possible next studies.

The final step is important because statistical conclusions are conditional on the study’s design and assumptions. A conclusion about a particular sample or experiment may suggest further questions rather than settle a broad scientific issue. Asking what should be studied next also helps students see that statistical analysis is part of an ongoing process of inquiry.


Example: Can dolphins communicate abstract ideas?

The study and research question

In an experiment involving two dolphins, one dolphin could see a visual signal while the other could not. The dolphins had been trained to respond to two visual cues:

  • A steady light indicated that one button was correct.

  • A flashing light indicated that the other button was correct.

During the experiment, the dolphin that could see the light, Doris, could not reach the buttons. Buzz, who could reach the buttons, could not see the light because a barrier blocked his view. When the light flashed, Doris made sounds and Buzz selected the correct button. Across 161616 trials, Buzz chose the correct button 151515 times.

The research question was whether Buzz was communicating something other than a random guess—for example, whether Doris was communicating information about which button to choose.

The result alone does not settle the question. The study’s design must also be considered. For example, the researchers needed to ensure that Buzz could not see the light or receive some other cue. The inference also concerns these dolphins under the conditions studied; it does not automatically establish what all dolphins can do.

A chance model and simulation

A simple chance explanation is that Buzz was guessing between two buttons, giving him a probability of 12\frac{1}{2}21​ of choosing correctly on each trial. Under this model, the observed statistic is the number of correct choices in 161616 trials.

To investigate whether 151515 correct choices could reasonably occur by chance:

  1. Represent a guess with a coin flip, treating one outcome as a correct choice.

  2. Simulate 161616 guesses by flipping a coin 161616 times.

  3. Count the number of correct choices in each simulation.

  4. Repeat the process many times to see the distribution of results expected from guessing.

Classroom coin-flipping can make the model tangible: each student performs a set of 161616 flips and records the number of “correct” outcomes. A computer can then carry out many more repetitions quickly. The resulting simulated distribution is generally centered near 888 correct choices, although other results occur. A result of 151515 correct choices is possible by chance, but is rare compared with results near the center.

Thus, under the guessing model, the observed result is unusually high. This provides evidence that Buzz may not have been guessing randomly. The conclusion remains conditional on the study design and the chance model: the simulation evaluates the guessing explanation, not every possible alternative explanation.

Introducing formal ideas gradually

The dolphin example can introduce the logic of a significance test before students learn terms such as null hypothesis, alternative hypothesis, sampling distribution, or binomial distribution. The central reasoning is already available: decide what chance would predict, simulate that chance process, and judge whether the observed outcome is unusual.

Formal vocabulary and theory can be added later. The simulation first gives students an intuitive foundation for understanding why a small P-value represents evidence against a chance explanation.


The four pillars of statistical inference

A course organized around statistical investigations can emphasize four connected aims:

Inference

Inference assesses whether observed data provide evidence for a claim or against a chance explanation. Significance tests are one way of making this assessment.

Estimation

Estimation uses sample data to quantify an unknown population value. A confidence interval, for example, gives a range of plausible values for a parameter while accounting for sampling variability.

Generalizability

Generalizability concerns whether conclusions from the observed sample apply to a broader population. It depends importantly on how the sample was selected. A large sample does not by itself eliminate bias caused by an unrepresentative sampling method.

Causation

Causation concerns whether a change in one variable produces a change in another. A well-designed randomized experiment can support cause-and-effect conclusions because random assignment helps create comparable treatment groups. Observational studies can reveal associations, but confounding variables may offer alternative explanations for those associations.

These ideas can be revisited across different studies, helping students connect study design, data exploration, inference, and interpretation.


Organizing a course around studies

One way to build a cohesive introductory course is to introduce the main purposes of inference early, then organize later material by type of study. Each study-focused unit can bring together:

  • The research question and study design

  • Descriptive summaries and visualizations

  • Simulation-based inference

  • Relevant theoretical methods

  • Interpretation and limitations

This organization makes it easier to show how the same investigative process applies across different statistical methods. Students can still study procedures such as t-tests, chi-square tests, analysis of variance, and regression, while learning them within the context of research questions and data.

A flexible course can introduce concepts through a guided activity, a discussion-based lecture, or a worked example. Providing both structured discovery questions and fully worked explanations can support different teaching approaches and give students a reference when they need additional explanation.

Real data and active learning

Real studies can make statistical reasoning meaningful and give students opportunities to critique how data were gathered. Activities may include discussion, guided exploration, data visualization, or a hands-on simulation. Familiar objects such as coins or cards can make the chance model concrete before students see a computer perform the same process.

Real data also require careful attention to context. Topics such as public health can offer valuable opportunities to study evidence, sampling, and bias, but instructors should consider whether students are ready to engage with a particular subject.


Simulation across different kinds of data

The three-S strategy applies beyond a single sample proportion. The key is to choose a statistic that matches the research question and to simulate in a way that represents the study’s design.

Comparing two groups

Suppose an experiment randomly assigns participants to two groups and measures a numerical outcome. A natural statistic might be the difference in group means.

To simulate the chance explanation of no treatment effect:

  1. Keep the observed outcome values.

  2. Randomly reassign those values to the two groups, preserving the original group sizes.

  3. Calculate the difference in means for each reassignment.

  4. Repeat the process to create a distribution of differences expected under no effect.

  5. Compare the observed difference with the simulated distribution.

This procedure is called rerandomization. For an experiment, reshuffling outcomes according to the original random assignment reflects the design. If the observed difference is far into the tail of the simulated distribution, it is unusual under the no-effect model.

The difference in means is often easier to interpret than a standardized test statistic at the beginning of learning. Students can first ask what quantity would describe the group difference, then learn why a standardized statistic such as a t-statistic may also be useful.

Correlation and regression

For two quantitative variables, a regression slope can describe the direction and magnitude of a linear relationship. To simulate a chance explanation of no association, the values of one variable can be shuffled relative to the values of the other variable. This preserves the observed values of each variable while disrupting their pairings.

A slope is then calculated for each shuffled data set. Repeating the shuffle produces an empirical null distribution of slopes expected when the pairings are unrelated. The observed slope can be compared with that distribution to assess how unusual the observed association would be under the no-association model.

This method links the simulation directly to the research question: if the relationship between the variables is the feature of interest, the statistic and simulation should both target that relationship.

Choosing statistics that fit the question

The statistic need not always be a mean or slope. For example, a comparison of group medians may be more suitable when the data contain strong skewness or outliers. Other possible statistics include the relative risk for comparing outcomes between groups.

Choosing a statistic that matches the question helps make the analysis more interpretable. Simulation can be used with many such statistics, so students can apply the same reasoning even when they encounter a new measure.


Simulation, theory, and assumptions

Simulation-based methods are not assumption-free. A simulation must represent the relevant chance process and respect the study design. For example, a randomization test should reproduce the assignment mechanism of the experiment, while a shuffle test for association should preserve the individual values but break their pairings.

The advantage of simulation is that it can make the chance model visible. Students can see how the simulated distribution changes and compare it with an observed statistic. This can also help them understand the role of assumptions about sample size, skewness, or the shape of a distribution.

Theoretical distributions as approximations

Traditional inference often uses mathematical distributions, such as a t-distribution, to approximate the results that repeated sampling or randomization would produce. A theoretical distribution can be overlaid on a simulated distribution to show how well the approximation fits.

When the simulated and theoretical distributions are close, the theoretical method may provide a useful approximation. When they differ substantially, conditions needed for that approximation may not hold well, and simulation may provide a useful alternative.

This comparison can help students understand that theoretical methods are not arbitrary formulas: they are mathematical models of what repeated chance processes are expected to produce. Simulation makes those processes observable, while theory can provide a compact and efficient description.


Multivariable thinking and blocking

Real-world outcomes may depend on several variables at once. Multivariable thinking means considering how multiple variables may relate to an outcome and how these relationships can affect interpretation. It is important when distinguishing an association from a causal effect, since a third variable may confound the observed relationship between two others.

Visual tools can help students explore multiple variables—for instance, by examining a scatterplot while marking observations according to a categorical variable or a second quantitative variable. Such displays can reveal patterns that would be missed by considering only two variables at a time.

Blocking in experimental design

A block design groups experimental units according to a relevant characteristic before assigning treatments. Blocking can help control variation associated with that characteristic.

In a randomized complete block design, treatment assignments are randomized within each block. The simulation must preserve that structure: outcomes or treatment labels are shuffled within blocks rather than across the entire study. Repeating this constrained randomization produces a null distribution that reflects the design.

Blocking illustrates a general principle of SBI: the simulated process must reproduce the relevant features of how the data were generated.


Assessment of statistical reasoning

Assessment can evaluate whether students understand the reasoning behind inference, not just whether they can carry out a calculation. Useful prompts ask students to:

  • Identify the observed statistic and explain what it measures.

  • State the chance model or null hypothesis.

  • Describe how the simulation should be performed.

  • Interpret a simulated distribution in the context of the study.

  • Identify or interpret the P-value.

  • Explain how the result answers the research question.

  • Discuss assumptions, limitations, or possible follow-up studies.

For example, an exam may present a simulated distribution and ask what values should have been entered into the simulation, what statistic was calculated, or where the P-value appears. Students can interpret a prepared graph without needing the technology during the exam.

Asking students to mark the region corresponding to a P-value can test several ideas at once. Students must understand which outcomes count as at least as extreme as the observed statistic, whether the test is one-sided or two-sided, and how tail area relates to evidence under the null model.

Assessment can also test transfer. Students might explain how they would apply the three-S strategy to a new context, such as comparing relative risks. They should describe the chance model, what would be shuffled or simulated, what statistic would be calculated, and how the result would be interpreted.

Finally, assessment should distinguish between questions suited to inference and questions that may be answered adequately by description. Not every data question requires a formal significance test.


Applying SBI in online and technology-supported teaching

Hands-on simulations can be adapted for online learning. Instructors can demonstrate coin flips or card shuffling on video, ask students to perform a simulation with materials at home, or use software to display the process. The key is to preserve the conceptual connection between the physical process and the computer simulation.

Technology is most useful when it makes the chance model understandable rather than turning analysis into a black box. A visual applet that shows values being shuffled or reassigned can help students connect an in-class activity with a large number of computer repetitions. Students can then see how each repetition contributes a statistic to the simulated distribution.

Technology can also be combined with conventional statistical software. Students might first explore a dynamic visual simulation, then examine the corresponding output from a statistical package. The visual explanation helps them interpret software output, including what a P-value means, rather than merely locating it in a report.


Central ideas

  • Simulation-based inference uses repeated chance models to show what results would be expected under a specified explanation.

  • The three-S strategy—statistic, simulate, strength of evidence—applies across many kinds of statistical questions.

  • The six-step investigation process connects inference to research questions, study design, data exploration, conclusions, and further inquiry.

  • Simulations should reflect how the data were generated, including random assignment, sampling, or blocking.

  • Theoretical distributions can be understood as mathematical approximations to results produced by chance processes.

  • Students gain a stronger conceptual foundation when statistical procedures are taught in context and connected to the full research process.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent