Skip to content

Repository files navigation

varequal

Repo_Status_Badge CRAN_Status_Badge R-CMD-check Downloads Downloads

An R package for testing whether group variances are equal.

There are also other nice alternatives such as vartest and other friends.

Installation

You can install the package from CRAN with:

install.packages("varequal")

or the development version from GitHub with:

if (!require("pak")) install.packages("pak")
pak::pak("P10911004-NPUST/varequal")

Quick start

is_var_equal(roGFP[[1]], ro ~ grp)

Benchmark

O_O: observe is homo, predict as homo
O_X: observe is homo, predict as hetero
X_X: observe is hetero, predict as hetero
X_O: observe is hetero, predict as homo
Type 1 error: O_X / (O_O + O_X) × 100%
Type 2 error: X_O / (X_X + X_O) × 100%
Accuracy: (O_O + X_X) / (O_O + O_X + X_X + X_O) × 100%

For normally-distributed, moderate sample size (8 ≤ n ≤ 20), and outliers-free data

O_O O_X X_X X_O Type 1 error (%) Type 2 error (%) Accuracy (%)
Ansari-Bradley test 974 26 749 251 2.6 25.1 86.15
Bartlett's test 939 61 985 15 6.1 1.5 96.20
Mehrotra-Brown-Forsythe test 977 23 767 233 2.3 23.3 87.20
Brown-Forsythe test 973 27 823 177 2.7 17.7 89.80
Fligner-Killeen test 976 24 824 176 2.4 17.6 90.00
't Lam's G test 919 81 982 18 8.1 1.8 95.05
Levene's test 973 27 864 136 2.7 13.6 91.85
O'Brien test 983 17 625 375 1.7 37.5 80.40
O'Neill-Mathews test 983 17 820 180 1.7 18.0 90.15

For normally-distributed, small sample size (3 ≤ n ≤ 7), and outliers-free data.

O_O O_X X_X X_O Type 1 error (%) Type 2 error (%) Accuracy (%)
Ansari-Bradley test 967 33 104 896 3.3 89.6 53.55
Bartlett's test 957 43 440 560 4.3 56.0 69.85
Mehrotra-Brown-Forsythe test 991 9 61 939 0.9 93.9 52.60
Brown-Forsythe test 986 14 75 925 1.4 92.5 53.05
Fligner-Killeen test 978 22 97 903 2.2 90.3 53.75
't Lam's G test 840 160 607 393 16.0 39.3 72.35
Levene's test 973 27 121 879 2.7 87.9 54.70
O'Brien test 996 4 30 970 0.4 97.0 51.30
O'Neill-Mathews test 994 6 58 942 0.6 94.2 52.60

For normally-distributed and moderate sample size (8 ≤ n ≤ 20) data, with one or two outliers.

O_O O_X X_X X_O Type 1 error (%) Type 2 error (%) Accuracy (%)
Ansari-Bradley test 972 28 843 157 2.8 15.7 90.75
Bartlett's test 0 1000 1000 0 100.0 0.0 50.00
Mehrotra-Brown-Forsythe test 1000 0 590 410 0.0 41.0 79.50
Brown-Forsythe test 1000 0 745 255 0.0 25.5 87.25
Fligner-Killeen test 974 26 910 90 2.6 9.0 94.20
't Lam's G test 0 1000 1000 0 100.0 0.0 50.00
Levene's test 1000 0 790 210 0.0 21.0 89.50
O'Brien test 1000 0 101 899 0.0 89.9 55.05
O'Neill-Mathews test 1000 0 713 287 0.0 28.7 85.65

TODO

About

An R package for assessing data homoscedasticity.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages