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
either fail if it is unbalanced
or find another way to deal with unbalanced design in TWA
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