---
title: "Session 13 — Simulate reversion to the mean"
author: "Prof. Dae-Jin Lee (daelee@faculty.ie.edu)"
date: "Fall 2026"
output:
  html_document:
    toc: true
    theme: flatly
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(tidyverse)
```

Stable support plus independent noise each wave — **no intervention**.

```{r}
set.seed(321)
n <- 500
stable_support <- rnorm(n, mean = 50, sd = 10)

sim <- tibble(
  wave1 = stable_support + rnorm(n, 0, 8),
  wave2 = stable_support + rnorm(n, 0, 8)
)

ggplot(sim, aes(x = wave1, y = wave2)) +
  geom_point(alpha = 0.4) +
  geom_abline(slope = 1, intercept = 0, linetype = 2) +
  labs(
    title = "Repeated measurements (no treatment effect)",
    x = "Wave 1",
    y = "Wave 2"
  )
```

Points fan around the 45-degree line; extremes are partly luck.
