Creates a reproducible respondent-level dataset with a linear no-event trend and heterogeneous post-event effects. It is intended for examples, teaching, and smoke tests rather than power analysis.
Examples
if (requireNamespace("dplyr", quietly = TRUE)) {
dat <- simulate_eventsurvey()
dat |>
dplyr::group_by(day) |>
dplyr::summarise(mean = mean(y), .groups = "drop")
}
#> # A tibble: 38 × 2
#> day mean
#> <int> <dbl>
#> 1 -30 44.3
#> 2 -29 44.5
#> 3 -28 45.6
#> 4 -27 45.6
#> 5 -26 45.7
#> 6 -25 45.8
#> 7 -24 45.2
#> 8 -23 46.6
#> 9 -22 45.3
#> 10 -21 46.4
#> # ℹ 28 more rows