levene.test {vartest}R Documentation

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 lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a tibble or data frame containing the variables in formula.

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. "absoluate": 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 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 lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

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

leveneTest

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")


[Package vartest version 1.2 Index]