fligner_test: Fligner-Killeen Test

View source: R/fligner_test.R

fligner_testR Documentation

Fligner-Killeen Test

Description

Provides a pipe-friendly framework to perform the Fligner-Killeen test, a non-parametric (rank-based) test of the homogeneity of group variances. It is robust against departures from normality and is a useful alternative to levene_test(). Wrapper around the function fligner.test().

See the Datanovia tutorial Homogeneity of Variance Test in R for a worked walkthrough.

Usage

fligner_test(data, formula, ...)

Arguments

data

a data.frame containing the variables in the formula.

formula

a formula of the form x ~ group where x is a numeric variable giving the data values and group is a factor with one or multiple levels giving the corresponding groups. For example, formula = TP53 ~ cancer_group.

...

other arguments to be passed to the function fligner.test.

Value

return a data frame with the following columns:

  • .y.: the y variable used in the test.

  • n: sample count.

  • statistic: the Fligner-Killeen test statistic (a chi-squared statistic) used to compute the p-value.

  • df: the degrees of freedom.

  • p: p-value.

  • method: the statistical test used to compare groups.

See Also

levene_test The Datanovia tutorial: Homogeneity of Variance Test in R.

Examples

# Load data
#:::::::::::::::::::::::::::::::::::::::
data("ToothGrowth")
df <- ToothGrowth

# Fligner-Killeen test
#:::::::::::::::::::::::::::::::::::::::::
df %>% fligner_test(len ~ dose)

# Grouped data
df %>%
  group_by(supp) %>%
  fligner_test(len ~ dose)

rstatix documentation built on July 24, 2026, 1:06 a.m.