strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

feature request: confidence intervals for `cramer` and `phi` #69

Closed IndrajeetPatil closed 5 years ago

IndrajeetPatil commented 5 years ago

Is it possible to add support for confidence intervals for Cramer's V and phi effect sizes for contingency table analyses, just like omega- and eta-squared?

strengejacke commented 5 years ago

Something like

efc %>% 
  select(e16sex, c161sex) %>% 
  sjstats::bootstrap(1000) %>% 
  mutate(
    tables = lapply(strap, function(x) {
      dat <- as.data.frame(x)
      table(dat$e16sex, dat$c161sex)
    }),
    cramers = sapply(tables, function(x) cramer(x))
  ) %>% 
  boot_ci(cramers)

?

IndrajeetPatil commented 5 years ago

Yeah, that sounds about right!

strengejacke commented 5 years ago

I just see that would require some breaking changes in the function-design. I need the data for bootstrapping, currently cramer() requires the table-object.