homogtestTwoWay: Variance Homogeneity Tests for Two-Way Layout

View source: R/homogtestTwoWay.R

homogtestTwoWayR Documentation

Variance Homogeneity Tests for Two-Way Layout

Description

homogtestTwoWay performs variance homogeneity tests including Levene, Bartlett, Fligner-Killeen tests for two-way layout.

Usage

homogtestTwoWay(formula, data, method = c("Levene", "Bartlett", "Fligner"), 
  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 two factors.

data

a 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 homogenity. 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 corresponding distribution of the test statistic. The corresponding distribution is F distribution for Levene's test, Chi-square disribution for Bartlett's test and Fligner-Killeen test.

p.value

the p-value of the test.

Author(s)

Osman Dag, Malwane Ananda, Sam Weerahandi

See Also

leveneTest bartlett.test fligner.test

Examples


library(twowaytests)
data(alveolar)

homogtestTwoWay(cell ~ ovalbumin*treatment, data = alveolar)
homogtestTwoWay(cell ~ ovalbumin*treatment, data = alveolar, method = "Bartlett")


twowaytests documentation built on March 31, 2023, 9:26 p.m.