Compute and return information on tests for the homogeneity of data.
Usage
variance_tests(
data,
tests = c("ratio", "levene", "bartlett", "fligner"),
ratio.threshold = 4
)Details
Tests require independent, quantitative data unless otherwise specified. Ratio: Looks at the ratio of largest to smallest variance. Rule of thumb is that if this ratio is less than 4, no major violations are observed Levene: No other major assumptions Bartlett: Requires normally distributed data and no major outliers Fligner: Also called Fligner-Killeen. Non-parametric test Hartley: Requires normal distribution and equal number of observations.
Examples
data <- data.frame(
"value" = c(rnorm(14, sd = 2), rnorm(6), rnorm(20, mean = 2)),
"group" = c(rep("A", 14), rep("B", 6), rep("C", 20))
)
variance_tests(data)
#> $var
#> A B C
#> 2.967607 1.033159 1.012913
#>
#> $ratio
#> [1] 2.929775
#>
#> $ratio.threshold
#> [1] 4
#>
#> $levene_pvalue
#> [1] 0.1270754
#>
#> $bartlett_pvalue
#> [1] 0.08664783
#>
#> $fligner_pvalue
#> [1] 0.006107502
#>