Description
Add Welch's ANOVA and Brown-Forsythe ANOVA — robust alternatives to one-way ANOVA when the equal variance assumption is violated (i.e., when Levene's test is significant).
- Welch's ANOVA — uses weighted group means and Satterthwaite-approximated degrees of freedom
- Brown-Forsythe ANOVA — similar approach with a different weighting scheme
The existing oneWayAnova() assumes homogeneity of variances. When leveneTest() rejects this assumption, users currently have no robust ANOVA alternative. FDistribution is already available for p-value computation.
Example usage
val groups = arrayOf(groupA, groupB, groupC)
// Check variance homogeneity
val levene = leveneTest(*groups)
if (levene.pValue < 0.05) {
// Variances unequal — use Welch's ANOVA
val result = welchAnova(*groups)
result.statistic // F statistic
result.pValue // significance
}
Related to #62
Description
Add Welch's ANOVA and Brown-Forsythe ANOVA — robust alternatives to one-way ANOVA when the equal variance assumption is violated (i.e., when Levene's test is significant).
The existing
oneWayAnova()assumes homogeneity of variances. WhenleveneTest()rejects this assumption, users currently have no robust ANOVA alternative.FDistributionis already available for p-value computation.Example usage
Related to #62