Skip to content

[BUG] Incorrect F-test denominator assignments in TwoWayAnovaModel #349

@LibraChris

Description

@LibraChris

Describe the bug

In the current implementation of TwoWayAnovaModel, the logic for assigning denominator mean squares in F-test creation is incorrect for all three model types. This leads to incorrect results when performing two-way ANOVA.

Steps to reproduce the behavior:

Compare two way anova results to implementations of R or python

Expected Behavior

Each TwoWayAnovaModel type should use the correct denominator mean square for its F-tests:

  • Fixed: denominator = error mean squares
  • Random: denominator = factor mean squares (depending on nesting)
  • Mixed: denominator = error mean squares for fixed factor, factor mean squares for random factor

Actual Behavior

The denominator assignments are mismatched:

  • Fixed case is using Random logic
  • Random case is using Mixed logic
  • Mixed case is using Fixed logic

This causes incorrect F-test values and potentially invalid conclusions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions