An Interactive webR Approach to Teaching Statistical Inference to Behavioral Science Students

Null Hypothesis Significance Testing via Permutation Tests

Kimberly Henry

Why Permutation Tests?

  • Problem: Students struggle with NHST’s abstract logic (p-values, sampling distributions)
  • Solution: Permutation tests make inference visual and intuitive

Exploration via WebR

The Study

The Game

Special Boulder

The Experimental Conditions

\[ H_{0}: \mu_{\mathrm{CI}} - \mu_{\mathrm{CI\ rescaled}} = 0 \]

1: Select & Observe

Pick two conditions & calculate observed difference

2: Shuffle Labels to Test the Null

3: Build the Null Distribution

4: Calculate Empirical p-value

What proportion of random shuffles produced effects as large as the real data?

p = 0.048 (4.8% of 5000 permutations)

5: Compute the Standard Error

Standard Error (SE) (i.e., SD of null distribution): 5.785 

6: Construct the Test Statistic

Group Difference/SE = Standardized Test Statistic

7: Compare to a Parametric Approach

my_groups |> 
  infer::t_test(wtp_final ~ graph_type, 
         var.equal = TRUE,
         order = c("CI rescaled", "CI"),
         alternative = "two-sided") |> 
  select(estimate, statistic, p_value )

Instructor Benefits

  • Zero setup: Runs in-browser (webR)
  • Reusable: GitHub repo for easy adoption
  • Flexible: Adaptable to other datasets

🔗 Links: https://KimberlyHenry.github.io/UseR2025/