| Type: | Package |
| Title: | Tests for Variance Homogeneity |
| Version: | 1.5 |
| Date: | 2026-04-22 |
| Depends: | R (≥ 3.2.0) |
| Imports: | stats, SuppDists, psych, moments, PearsonDS |
| Suggests: | testthat |
| Author: | Gozde Cosar [aut], Muhammed Ali Yilmaz [aut], Merve Kasikci [aut], Osman Dag [aut, cre] |
| Maintainer: | Osman Dag <osman.dag@outlook.com> |
| Description: | Performs 18 omnibus tests yielding a total of 28 distinct methodological variations for testing the composite hypothesis of variance homogeneity. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| Packaged: | 2026-04-22 09:35:25 UTC; USER |
| Repository: | CRAN |
| Date/Publication: | 2026-04-22 10:00:03 UTC |
Ansari Bradley Test
Description
ansari.test performs Ansari Bradley variance homogeneity test.
Usage
ansari.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Ansari Bradley Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
See Also
Examples
library(vartest)
ansari.test(Sepal.Length ~ Species, data = iris)
out <- ansari.test(Sepal.Length ~ Species, data = iris)
summary(out)
Bartlett's Test
Description
bartletts.test performs Bartlett variance homogeneity test.
Usage
bartletts.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Bartlett's Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Lee, H.B., Katz, G.S., Restori, A.F. (2010). A Monte Carlo Study of Seven Homogeneity of Variance Tests. Journal of Mathematics and Statistics, 6:3, 359-366.
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
See Also
Examples
library(vartest)
bartletts.test(Sepal.Length ~ Species, data = iris)
out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)
Capon Test
Description
capon.test performs Capon variance homogeneity test.
Usage
capon.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Capon Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Capon, J. (1961). Asymptotic Efficiency of Certain Locally Most Powerful Rank Tests. The Annals of Mathematical Statistics, 32:1, 88-100.
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Examples
library(vartest)
capon.test(Sepal.Length ~ Species, data = iris)
out <- capon.test(Sepal.Length ~ Species, data = iris)
summary(out)
Cochran's C Test
Description
cochrans.test performs Cochran's C variance homogeneity test.
Usage
cochrans.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Cochran's C Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Wang, Y., Gil, P.R., Chen, Y.H., Kromrey, J.D., Kim, E.S., Pham, T., Nguyen, D., Romano, J.L. (2017). Comparing the Performance of Approaches for Testing the Homogeneity of Variance Assumption in One-Factor Anova Models. Educational and Psychological Measurement, 77:2, 305-329.
Cochran, W.G. (1941). The Distribution of The Largest of a set of Estimated Variances as a Fraction of Their Total. Annals of Eugenics, 11:1, 47-52.
See Also
Examples
library(vartest)
cochrans.test(Sepal.Length ~ Species, data = iris)
out <- cochrans.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)
David Barton Test
Description
david.barton.test performs David Barton variance homogeneity test.
Usage
david.barton.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "David Barton Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Barton, D.E., David, F.N. (1958). A Test For Birth Order Effect. Annals of Human Genetics, 22:3, 250-257.
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Gibbons, J.D., Chakraborti, S. (2010). Nonparametric Statistical Inference. CRC Press, 5th Ed., 316-320.
Examples
library(vartest)
david.barton.test(Sepal.Length ~ Species, data = iris)
out <- david.barton.test(Sepal.Length ~ Species, data = iris)
summary(out)
Duran Test
Description
duran.test performs Duran variance homogeneity test.
Usage
duran.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters. This median-centered variant of the test is also referred to as the Conover-Iman test in literature (Conover and Iman, 1978).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Duran Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Iman, R.L.(1978). Some Exact Tables For The Squared Ranks Test. Communications in Statistics - Simulation and Computation, B7(5), 491-513.
Examples
library(vartest)
duran.test(Sepal.Length ~ Species, data = iris)
out <- duran.test(Sepal.Length ~ Species, data = iris)
summary(out)
Fisher's Test
Description
f.test performs Fisher's variance homogeneity test.
Usage
f.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Fisher's Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Gorbunova, A.A., Lemeshko, B.Y. (2012). Application of Parametric Homogeneity of Variances Tests under Violation of Classical Assumption. 2nd Stochastic Modeling Techniques and Data Analysis International Conference, 5:8, 253-260.
Examples
library(vartest)
f.test(Sepal.Length ~ Species, data = iris)
out <- f.test(Sepal.Length ~ Species, data = iris)
summary(out)
Fligner-Killeen Test
Description
fk.test performs Fligner-Killeen variance homogeneity test.
Usage
fk.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Fligner-Killeen Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Fligner, M.A., Killeen, T.J.(1976). Distribution-Free Two-Sample Tests for Scale. Journal of the American Statistical Association, 71:353, 210-213.
See Also
Examples
library(vartest)
fk.test(Sepal.Length ~ Species, data = iris)
out <- fk.test(Sepal.Length ~ Species, data = iris)
summary(out)
G Test
Description
g.test performs G variance homogeneity test.
Usage
g.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "G Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
UE't Lam, R. (2010). Scrutiny of Variance Results for Outliers: Cochran's Test Optimized. Analytica Chimica Acta, 659(1-2), 68-84.
Wang, Y., Gil, P.R., Chen, Y.H., Kromrey, J.D., Kim, E.S., Pham, T., Nguyen, D., Romano, J.L. (2017). Comparing the Performance of Approaches for Testing the Homogeneity of Variance Assumption in One-Factor Anova Models. Educational and Psychological Measurement, 77:2, 305-329.
Examples
library(vartest)
g.test(Sepal.Length ~ Species, data = iris)
out <- g.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)
Hartley's Maximum F-Ratio Test
Description
hartley.test performs Hartley's Maximum F-Ratio variance homogeneity test.
Usage
hartley.test(formula, data, size = "mean", alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
size |
a character string to define how to number of group observation. "mean": mean, "harmonic": harmonic mean, "maxn": maximum n, and "minvar": minimum variance. |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components::
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the maximum F-ratio distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Hartley's Maximum F-Ratio Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Gorbunova, A.A., Lemeshko, B.Y. (2012). Application of Parametric Homogeneity of Variances Tests under Violation of Classical Assumption. 2nd Stochastic Modeling Techniques and Data Analysis International Conference, 5:8, 253-260.
Bhandary, M., Dai, H. (2008). An Alternative Test for the Equality of Variances for Several Populations When the Underlying Distributions are Normal. Communications in Statistics-Simulation and Computation, 38:1, 109-117.
See Also
Examples
library(vartest)
hartley.test(Sepal.Length ~ Species, data = iris, size = "mean")
out <- hartley.test(Sepal.Length ~ Species, data = iris, size = "mean")
summary(out)
Klotz Test
Description
klotz.test performs Klotz variance homogeneity test.
Usage
klotz.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Klotz Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Klotz, J. (1962). Nonparametric Tests for Scale. The Annals of Mathematical Statistics, 33:2, 498-512.
See Also
Examples
library(vartest)
klotz.test(Sepal.Length ~ Species, data = iris)
out <- klotz.test(Sepal.Length ~ Species, data = iris)
summary(out)
Levene's Test
Description
levene.test performs Levene variance homogeneity test.
Usage
levene.test(formula, data, center = "mean", deviation = "absolute",
trim.rate = 0.25, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
center |
a character string to define how to center. "mean": mean, "median": median, and "trim.mean": trimmed mean. |
deviation |
a character string to define how to specify the deviation. "absolute": absolute deviation and "squared": squared deviation. |
trim.rate |
the rate of observations trimmed from each tail of the distribution. Default is set to 0.25. |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Levene's Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Wang, Y., Gil, P.R., Chen, Y.H., Kromrey, J.D., Kim, E.S., Pham, T., Nguyen, D., Romano, J.L. (2017). Comparing the Performance of Approaches for Testing the Homogeneity of Variance Assumption in One-Factor Anova Models. Educational and Psychological Measurement, 77:2, 305-329.
Brown, M.B., Forsythe, A.B. (1974). Robust Tests for the Equality of Variances. Journal of the American Statistical Association, 69:346, 364-367.
See Also
Examples
library(vartest)
levene.test(Sepal.Length ~ Species, data = iris, center="median", deviation="absolute")
levene.test(Sepal.Length ~ Species, data = iris, center="median", deviation="squared")
levene.test(Sepal.Length ~ Species, data = iris, center="mean", deviation="absolute")
levene.test(Sepal.Length ~ Species, data = iris, center="mean", deviation="squared")
levene.test(Sepal.Length ~ Species, data = iris, center="trim.mean", deviation="absolute")
levene.test(Sepal.Length ~ Species, data = iris, center="trim.mean", deviation="squared")
out <- levene.test(Sepal.Length~Species, data=iris, center="median", deviation="absolute")
summary(out)
Mood Test
Description
mood.test performs Mood variance homogeneity test.
Usage
mood.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Mood Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Mood, A.M. (1954). On the Asymptotic Efficiency of Certain Nonparametric Two-Sample Tests. The Annals of Mathematical Statistics, 25:3, 514-522.
See Also
Examples
library(vartest)
mood.test(Sepal.Length ~ Species, data = iris)
out <- mood.test(Sepal.Length ~ Species, data = iris)
summary(out)
Modified Z Variance Test
Description
mzv.test performs Modified Z Variance variance homogeneity test.
Usage
mzv.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Modified Z Variance Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Wang, Y., Gil, P.R., Chen, Y.H., Kromrey, J.D., Kim, E.S., Pham, T., Nguyen, D., Romano, J.L. (2017). Comparing the Performance of Approaches for Testing the Homogeneity of Variance Assumption in One-Factor Anova Models. Educational and Psychological Measurement, 77:2, 305-329.
Overall, J.E., Woodward, J.A. (1974). A Simple Test for Heterogeneity of Variance in Complex Factorial Designs. Psychometrika, 39:3, 311-318.
Examples
library(vartest)
mzv.test(Sepal.Length ~ Species, data = iris)
out <- mzv.test(Sepal.Length ~ Species, data = iris)
summary(out)
O'Brien Test
Description
obrien.test performs O'Brien variance homogeneity test.
Usage
obrien.test(formula, data, center = "mean", trim.rate = 0.25, alpha = 0.05,
na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
center |
a character string to define how to center. "mean": mean, "median": median, and "trim.mean": trimmed mean. |
trim.rate |
the rate of observations trimmed from each tail of the distribution. Default is set to 0.25. |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "O'Brien Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
O'Brien, R.G. (1981). A Simple Test for Variance Effects in Experimental Designs. Psychological Bulletin, 89:3, 570-574.
Gorbunova, A.A., Lemeshko, B.Y. (2012). Application of Parametric Homogeneity of Variances Tests under Violation of Classical Assumption. 2nd Stochastic Modeling Techniques and Data Analysis International Conference, 5:8, 253-260.
Examples
library(vartest)
obrien.test(Sepal.Length ~ Species, data = iris, center = "mean")
out <- obrien.test(Sepal.Length ~ Species, data = iris, center = "mean")
summary(out)
Print Method for Summary of Variance Homogeneity Test Results
Description
Prints the formatted summary of a vht object to the console.
Usage
## S3 method for class 'summary.vht'
print(x, ...)
Arguments
x |
An object returned by |
... |
Additional arguments. |
Author(s)
Merve Kasikci and Osman Dag
See Also
Examples
out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)
Data-Driven Selection of the Optimal Variance Homogeneity Test
Description
select_vartest performs an automated, simulation-based evaluation to identify the optimal variance homogeneity test for a dataset.
Usage
select_vartest(formula, data, nrep = 1000, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
nrep |
an integer specifying the number of Monte Carlo replications to perform for the simulation. The default is |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
The function calculates the empirical moments of the input data and uses the Pearson distribution system to generate random datasets. By evaluating 28 distinct methodological modifications of variance homogeneity tests on these generated datasets, the function recommends the method that yields the highest adjusted power (with the lowest Type I error).
Value
A data frame presenting empirical power, Type I error rate, and adjusted power for each variance homogeneity test.
Author(s)
Muhammed Ali Yilmaz and Osman Dag
Examples
library(vartest)
out <- select_vartest(Sepal.Length ~ Species, data = iris, nrep = 1000)
out
Siegel Tukey Test
Description
siegel.tukey.test performs Siegel Tukey variance homogeneity test.
Usage
siegel.tukey.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Siegel Tukey Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Gibbons, J.D., Chakraborti, S. (2010). Nonparametric Statistical Inference. CRC Press, 5th Ed., 316-320.
Siegel, S., Tukey, J.W. (1960). A Nonparametric Sum of Ranks Procedure for Relative Spread in Unpaired Samples. Journal of the American Statistical Association, 55:291, 429-445.
See Also
Examples
library(vartest)
siegel.tukey.test(Sepal.Length ~ Species, data = iris)
out <- siegel.tukey.test(Sepal.Length ~ Species, data = iris)
summary(out)
Summary Method for Variance Homogeneity Test Results
Description
Provides a concise summary of the results from a variance homogeneity test in the package.
Usage
## S3 method for class 'vht'
summary(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments. |
Details
This method is specifically designed for objects of class vht. It prints test method, dependent variable, grouping variable, test statistic, degrees of freedom, and p-value.
Value
Prints a summary to the console.
Author(s)
Merve Kasikci and Osman Dag
Examples
out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)
Talwar and Gentle Test
Description
talwar.gentle.test performs Talwar and Gentle variance homogeneity test.
Usage
talwar.gentle.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Details
Prior to testing for variance homogeneity, the data within each group are centered by their corresponding group median to eliminate the confounding effects of location parameters (Conover et al., 1981).
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate chi-squared distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Talwar and Gentle Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Conover, W.J., Johnson, M.E., Johnson, M.M. (1981). A Comparative Study of Tests for Homogeneity of Variances, with Applications to the Outer Continental Shelf Bidding Data. Technometrics, 23:4, 351-361.
Talwar, P.P., Gentle, J.E. (1976). A Robust Test for the Homogeneity of Scales. Communications in Statistics - Theory and Methods, 6:4, 363-369.
Examples
library(vartest)
talwar.gentle.test(Sepal.Length ~ Species, data = iris)
out <- talwar.gentle.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)
Z Variance Test
Description
zv.test performs Z variance homogeneity test.
Usage
zv.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
Arguments
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess variance homogeneity. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Value
A list with class "vht" containing the following components:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate F distribution of the test statistic. |
p.value |
the p-value of the test. |
method |
the character string "Z Variance Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Author(s)
Gozde Cosar and Osman Dag
References
Gorbunova, A.A., Lemeshko, B.Y. (2012). Application of Parametric Homogeneity of Variances Tests under Violation of Classical Assumption. 2nd Stochastic Modeling Techniques and Data Analysis International Conference, 5:8, 253-260.
Wang, Y., Gil, P.R., Chen, Y.H., Kromrey, J.D., Kim, E.S., Pham, T., Nguyen, D., Romano, J.L. (2017). Comparing the Performance of Approaches for Testing the Homogeneity of Variance Assumption in One-Factor Anova Models. Educational and Psychological Measurement, 77:2, 305-329.
Overall, J.E., Woodward, J.A. (1974). A Simple Test for Heterogeneity of Variance in Complex Factorial Designs. Psychometrika, 39:3, 311-318.
Examples
library(vartest)
zv.test(Sepal.Length ~ Species, data = iris)
out <- zv.test(Sepal.Length ~ Species, data = iris, verbose = FALSE)
summary(out)