Add function for chi square. - #701
Conversation
|
You may take a look at the effectsize package where you can calculate lots of effect sizes from different R objects. |
|
Ok, I see the intention of this function. Maybe it's better to implement a |
|
Personally I don't really see the need for this function, it seems to simply replace a call to library(datawizard)
### Without data_chisq()
suppressWarnings({
orig <- head(mtcars) |>
data_tabulate() |>
as.table() |>
lapply(stats::chisq.test)
})
### With data_chisq()
suppressWarnings({
new <- head(mtcars) |>
data_tabulate() |>
data_chisq()
})
identical(orig, new)
#> [1] TRUE
I would be in favor of adding this as a method, but sloop::is_s3_generic("chisq.test")
#> [1] FALSE |
|
Sorry for the delay in responding, I was away on vacation for a few weeks, will think about the comments. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #701 +/- ##
==========================================
- Coverage 92.09% 92.01% -0.08%
==========================================
Files 76 77 +1
Lines 7727 7778 +51
==========================================
+ Hits 7116 7157 +41
- Misses 611 621 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This function follows the pattern in the documentation, and I found it useful to create it for my students. It might be good to let it make a caption the way that the
means_by_groups()has the ANOVA results.