performance
performance copied to clipboard
htest checks
Closes #401
- [x]
check_normality.htest
- [x]
check_homogeneity.htest
- [x]
check_symmetry.htest
? - [x] ~
check_N.htest
~ use - [ ]
check_model.htest
? - [ ] plotting in
{see}
? - [ ] Vignette
- [ ] Tests
check_normality
library(performance)
t.test(mtcars$mpg, mtcars$hp, var.equal = TRUE) |> check_normality()
#> Warning: Non-normality of residuals detected (p < .001).
t.test(mtcars$mpg, mtcars$hp, var.equal = FALSE) |> check_normality()
#> OK: Group1 appear as normally distributed (p = 0.123).
#> Warning: Non-normality of Group2 detected (p = 0.049).
t.test(mtcars$mpg) |> check_normality()
#> OK: residuals appear as normally distributed (p = 0.123).
t.test(mtcars$mpg, mtcars$hp, paired = TRUE) |> check_normality()
#> OK: residuals appear as normally distributed (p = 0.102).
oneway.test(mtcars$mpg ~ mtcars$cyl, var.equal = FALSE) |> check_normality()
#> OK: Group1 appear as normally distributed (p = 0.261).
#> OK: Group2 appear as normally distributed (p = 0.325).
#> OK: Group3 appear as normally distributed (p = 0.323).
oneway.test(mtcars$mpg ~ mtcars$cyl, var.equal = TRUE) |> check_normality()
#> OK: residuals appear as normally distributed (p = 0.538).
cor.test(mtcars$mpg, mtcars$hp) |> check_normality()
#> Warning: Non-normality of residuals detected (p = 0.005).
var.test(mtcars$mpg, mtcars$hp) |> check_normality()
#> OK: Group1 appear as normally distributed (p = 0.123).
#> Warning: Non-normality of Group2 detected (p = 0.049).
Created on 2022-07-07 by the reprex package (v2.0.1)
For Chisq:
chisq.test(mtcars$cyl, mtcars$gear) |> check_normality()
#> Warning: Some cells in the expected table have less than 5 observations
chisq.test(table(mtcars$cyl)) |> check_normality()
#> OK: All cells in the expected table have more than 10 observations
chisq.test(table(mtcars$cyl), p = c(0.2, 0.2, 0.6)) |> check_normality()
#> Warning: All cells in the expected table have more than 5 observations,
#> but some have less than 10.
check_homogeneity
library(performance)
t.test(mtcars$mpg, mtcars$hp, var.equal = TRUE) |> check_homogeneity()
#> Warning: Variances differ between groups (Bartlett Test, p = 0.000).
oneway.test(mtcars$mpg ~ mtcars$cyl, var.equal = TRUE) |> check_homogeneity()
#> Warning: Variances differ between groups (Bartlett Test, p = 0.015).
Created on 2022-07-07 by the reprex package (v2.0.1)
check_symmetry
library(performance)
wilcox.test(mtcars$mpg) |> check_symmetry()
#> OK: Data appears symmetrical (p = 0.119).
wilcox.test(mtcars$mpg, mtcars$hp, paired = TRUE) |> check_symmetry()
#> Warning: Non-symmetry detected (p = 0.008).
Created on 2022-07-07 by the reprex package (v2.0.1)
Next thing - fix the plotting functions in see... This will take some work...
Codecov Report
Merging #447 (3043b9d) into main (23d81d0) will decrease coverage by
0.93%
. The diff coverage is0.00%
.
@@ Coverage Diff @@
## main #447 +/- ##
==========================================
- Coverage 32.67% 31.74% -0.94%
==========================================
Files 80 82 +2
Lines 4682 4820 +138
==========================================
Hits 1530 1530
- Misses 3152 3290 +138
Impacted Files | Coverage Δ | |
---|---|---|
R/check_htest.R | 0.00% <0.00%> (ø) |
|
R/check_normality.R | 51.19% <0.00%> (-1.25%) |
:arrow_down: |
R/check_symmetry.R | 0.00% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
This is def on the back burner - unless someone wants to take over, I will get to this in like 8 weeks.
@mattansb Can we merge the current PR as is? I mean, we don't need the plotting functions right now, already having the general check-functions is great!
Sure (: