| Title: | Tests for Variance Homogeneity |
|---|---|
| Description: | Performs 18 omnibus tests yielding a total of 28 distinct methodological variations for testing the composite hypothesis of variance homogeneity. |
| Authors: | Gozde Cosar [aut], Muhammed Ali Yilmaz [aut], Merve Kasikci [aut], Osman Dag [aut, cre] |
| Maintainer: | Osman Dag <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.5 |
| Built: | 2026-05-22 08:57:56 UTC |
| Source: | https://github.com/cran/vartest |
ansari.test performs Ansari Bradley variance homogeneity test.
ansari.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)ansari.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) ansari.test(Sepal.Length ~ Species, data = iris) out <- ansari.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) ansari.test(Sepal.Length ~ Species, data = iris) out <- ansari.test(Sepal.Length ~ Species, data = iris) summary(out)
bartletts.test performs Bartlett variance homogeneity test.
bartletts.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)bartletts.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) bartletts.test(Sepal.Length ~ Species, data = iris) out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)library(vartest) bartletts.test(Sepal.Length ~ Species, data = iris) out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)
capon.test performs Capon variance homogeneity test.
capon.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)capon.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) capon.test(Sepal.Length ~ Species, data = iris) out <- capon.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) capon.test(Sepal.Length ~ Species, data = iris) out <- capon.test(Sepal.Length ~ Species, data = iris) summary(out)
cochrans.test performs Cochran's C variance homogeneity test.
cochrans.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)cochrans.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) cochrans.test(Sepal.Length ~ Species, data = iris) out <- cochrans.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)library(vartest) cochrans.test(Sepal.Length ~ Species, data = iris) out <- cochrans.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)
david.barton.test performs David Barton variance homogeneity test.
david.barton.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)david.barton.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) david.barton.test(Sepal.Length ~ Species, data = iris) out <- david.barton.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) david.barton.test(Sepal.Length ~ Species, data = iris) out <- david.barton.test(Sepal.Length ~ Species, data = iris) summary(out)
duran.test performs Duran variance homogeneity test.
duran.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)duran.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) duran.test(Sepal.Length ~ Species, data = iris) out <- duran.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) duran.test(Sepal.Length ~ Species, data = iris) out <- duran.test(Sepal.Length ~ Species, data = iris) summary(out)
f.test performs Fisher's variance homogeneity test.
f.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)f.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) f.test(Sepal.Length ~ Species, data = iris) out <- f.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) f.test(Sepal.Length ~ Species, data = iris) out <- f.test(Sepal.Length ~ Species, data = iris) summary(out)
fk.test performs Fligner-Killeen variance homogeneity test.
fk.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)fk.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) fk.test(Sepal.Length ~ Species, data = iris) out <- fk.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) fk.test(Sepal.Length ~ Species, data = iris) out <- fk.test(Sepal.Length ~ Species, data = iris) summary(out)
g.test performs G variance homogeneity test.
g.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)g.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) g.test(Sepal.Length ~ Species, data = iris) out <- g.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)library(vartest) g.test(Sepal.Length ~ Species, data = iris) out <- g.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)
hartley.test performs Hartley's Maximum F-Ratio variance homogeneity test.
hartley.test(formula, data, size = "mean", alpha = 0.05, na.rm = TRUE, verbose = TRUE)hartley.test(formula, data, size = "mean", alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) hartley.test(Sepal.Length ~ Species, data = iris, size = "mean") out <- hartley.test(Sepal.Length ~ Species, data = iris, size = "mean") summary(out)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 performs Klotz variance homogeneity test.
klotz.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)klotz.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) klotz.test(Sepal.Length ~ Species, data = iris) out <- klotz.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) klotz.test(Sepal.Length ~ Species, data = iris) out <- klotz.test(Sepal.Length ~ Species, data = iris) summary(out)
levene.test performs Levene variance homogeneity test.
levene.test(formula, data, center = "mean", deviation = "absolute", trim.rate = 0.25, alpha = 0.05, na.rm = TRUE, verbose = TRUE)levene.test(formula, data, center = "mean", deviation = "absolute", trim.rate = 0.25, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
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)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 performs Mood variance homogeneity test.
mood.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)mood.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) mood.test(Sepal.Length ~ Species, data = iris) out <- mood.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) mood.test(Sepal.Length ~ Species, data = iris) out <- mood.test(Sepal.Length ~ Species, data = iris) summary(out)
mzv.test performs Modified Z Variance variance homogeneity test.
mzv.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)mzv.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) mzv.test(Sepal.Length ~ Species, data = iris) out <- mzv.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) mzv.test(Sepal.Length ~ Species, data = iris) out <- mzv.test(Sepal.Length ~ Species, data = iris) summary(out)
obrien.test performs O'Brien variance homogeneity test.
obrien.test(formula, data, center = "mean", trim.rate = 0.25, alpha = 0.05, na.rm = TRUE, verbose = TRUE)obrien.test(formula, data, center = "mean", trim.rate = 0.25, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) obrien.test(Sepal.Length ~ Species, data = iris, center = "mean") out <- obrien.test(Sepal.Length ~ Species, data = iris, center = "mean") summary(out)library(vartest) obrien.test(Sepal.Length ~ Species, data = iris, center = "mean") out <- obrien.test(Sepal.Length ~ Species, data = iris, center = "mean") summary(out)
Prints the formatted summary of a vht object to the console.
## S3 method for class 'summary.vht' print(x, ...)## S3 method for class 'summary.vht' print(x, ...)
x |
An object returned by |
... |
Additional arguments. |
Merve Kasikci and Osman Dag
out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)
select_vartest performs an automated, simulation-based evaluation to identify the optimal variance homogeneity test for a dataset.
select_vartest(formula, data, nrep = 1000, alpha = 0.05, na.rm = TRUE, verbose = TRUE)select_vartest(formula, data, nrep = 1000, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
A data frame presenting empirical power, Type I error rate, and adjusted power for each variance homogeneity test.
Muhammed Ali Yilmaz and Osman Dag
library(vartest) out <- select_vartest(Sepal.Length ~ Species, data = iris, nrep = 1000) outlibrary(vartest) out <- select_vartest(Sepal.Length ~ Species, data = iris, nrep = 1000) out
siegel.tukey.test performs Siegel Tukey variance homogeneity test.
siegel.tukey.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)siegel.tukey.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) siegel.tukey.test(Sepal.Length ~ Species, data = iris) out <- siegel.tukey.test(Sepal.Length ~ Species, data = iris) summary(out)library(vartest) siegel.tukey.test(Sepal.Length ~ Species, data = iris) out <- siegel.tukey.test(Sepal.Length ~ Species, data = iris) summary(out)
Provides a concise summary of the results from a variance homogeneity test in the package.
## S3 method for class 'vht' summary(object, ...)## S3 method for class 'vht' summary(object, ...)
object |
An object of class |
... |
Additional arguments. |
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.
Prints a summary to the console.
Merve Kasikci and Osman Dag
out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)out <- bartletts.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)
talwar.gentle.test performs Talwar and Gentle variance homogeneity test.
talwar.gentle.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)talwar.gentle.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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).
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) talwar.gentle.test(Sepal.Length ~ Species, data = iris) out <- talwar.gentle.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)library(vartest) talwar.gentle.test(Sepal.Length ~ Species, data = iris) out <- talwar.gentle.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)
zv.test performs Z variance homogeneity test.
zv.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)zv.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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. |
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 |
Gozde Cosar and Osman Dag
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.
library(vartest) zv.test(Sepal.Length ~ Species, data = iris) out <- zv.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)library(vartest) zv.test(Sepal.Length ~ Species, data = iris) out <- zv.test(Sepal.Length ~ Species, data = iris, verbose = FALSE) summary(out)