BrownForsytheTest: Brown-Forsythe Test for Homogeneity of Variances (Manual...

View source: R/Brown_ForsythTest.R

BrownForsytheTestR Documentation

Brown-Forsythe Test for Homogeneity of Variances (Manual Implementation)

Description

Performs the Brown-Forsythe test using absolute deviations from the median of each group, followed by a one-way ANOVA on those deviations.

Usage

BrownForsytheTest(formula, data, alpha = 0.05)

Arguments

formula

A formula of the form y ~ group, where y is numeric and group is a factor.

data

A data frame containing the variables.

alpha

Significance level (default is 0.05).

Details

This test is a robust alternative to Bartlett's test, especially useful when the assumption of normality is violated or when outliers are present.

Advantages: - More robust than Bartlett's test under non-normal distributions. - Less sensitive to outliers due to the use of the median.

Disadvantages: - Lower power than Bartlett's test when normality strictly holds. - Assumes that absolute deviations follow similar distributions across groups.

Value

An object of class "homocedasticidad", with:

  • Statistic: F-statistic.

  • df1: Numerator degrees of freedom.

  • df2: Denominator degrees of freedom.

  • p_value: P-value.

  • Decision: "Heterocedastic" or "Homocedastic".

  • Method: "Brown-Forsythe".

References

Brown, M. B., & Forsythe, A. B. (1974). "Robust Tests for the Equality of Variances". Journal of the American Statistical Association, 69(346), 364–367.

Examples

data(d_e, package = "Analitica")
res <- BrownForsytheTest(Sueldo_actual ~ labor, data = d_e)
summary(res)



Analitica documentation built on June 14, 2025, 9:07 a.m.