Description
Add Scheffé's post-hoc test for comparisons after ANOVA. Unlike Tukey HSD (#39) which handles only pairwise comparisons, Scheffé's test supports arbitrary linear contrasts — weighted combinations of group means.
Uses the F-distribution for critical values. The test is more conservative than Tukey for pairwise comparisons, but uniquely handles complex contrasts like "group A vs average of groups B and C". All prerequisites exist: oneWayAnova() exposes msWithin, dfBetween, dfWithin in AnovaResult, and FDistribution is available in kstats-distributions.
Example usage
val groups = arrayOf(groupA, groupB, groupC, groupD)
val anova = oneWayAnova(*groups)
// Arbitrary contrast: group A vs average of B, C, D
val result = scheffeTest(groups, contrasts = doubleArrayOf(1.0, -1/3.0, -1/3.0, -1/3.0))
result.statistic // F statistic for the contrast
result.pValue // significance
Related to #39, #41, #62
Description
Add Scheffé's post-hoc test for comparisons after ANOVA. Unlike Tukey HSD (#39) which handles only pairwise comparisons, Scheffé's test supports arbitrary linear contrasts — weighted combinations of group means.
Uses the F-distribution for critical values. The test is more conservative than Tukey for pairwise comparisons, but uniquely handles complex contrasts like "group A vs average of groups B and C". All prerequisites exist:
oneWayAnova()exposesmsWithin,dfBetween,dfWithininAnovaResult, andFDistributionis available inkstats-distributions.Example usage
Related to #39, #41, #62