Learn R Programming

onewaytests (version 3.0)

homog.test: Variance Homogeneity Tests

Description

homog.test performs variance homogeneity tests including Levene, Bartlett, Fligner-Killeen tests.

Usage

homog.test(formula, data, method = c("Levene", "Bartlett", "Fligner"), 
  alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Value

A list containing the following components:

statistic

the corresponding test statistic.

parameter

the parameter(s) of the approximate corresponding distribution of the test statistic. The corresponding distribution is F distribution for Levene's test, Chi-square distribution for Bartlett's test and Fligner-Killeen test.

p.value

the p-value of the test.

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.

method

a character string to select one of the variance homogeneity tests. "Levene": Levene's test, "Bartlett": Bartlett's test, "Fligner": Fligner-Killeen test.

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.

Author

Osman Dag

See Also

Examples

Run this code

library(onewaytests)

homog.test(Sepal.Length ~ Species, data = iris)
homog.test(Sepal.Length ~ Species, data = iris, method = "Bartlett")

Run the code above in your browser using DataLab