Compare between seasons

S2 <- sc_two_seasons |>
  group_split(Season) |>
  map(bin_rates, LA_breaks, LS_breaks) |>
  set_names(c(2021, 2023)) |>
  list_rbind(names_to = "year")
  • Compare rates on logit scale to avoid endpoint issues
logit <- function(x){
  log(x) - log(100 - x)
}

d_BIP <- S2 |>
  select(year, LA, LS, BIP_Rate) |>
  pivot_wider(
    names_from = year, names_prefix = "y",
    values_from = BIP_Rate
  ) |>
  mutate(d_BIP_logits = logit(y2023) - logit(y2021))