fslaborg / FSharp.Stats

statistical testing, linear algebra, machine learning, fitting and signal processing in F#
https://fslab.org/FSharp.Stats/
Other
205 stars 54 forks source link

Two way Anova should fail early when design is unbalanced #254

Closed bvenn closed 1 year ago

bvenn commented 1 year ago

When performing a two way ANOVA (TWA) with unequal sample sizes (unbalanced design), the computation fails because of an ill-defined parametrization of the F distribution. While the TWA should fail when the design is unbalanced, it shouldn't even get get to this step. When the model is unbalanced, it causes correlation between the factors/interaction hence you don't know how to divide the shared sum of squares between the two factors.

Preferred solution Check input for balanced design and