Skip to content

Documentation request for X² test #302

Open

Description

@bvenn

Description

A proper explanation/tutorial for handling chi-squared-tests is missing. There seems to be at least three versions of the Chi-Square test existing:

  • distribution test
  • independence test
  • homogenity test

A description is needed that introduces the core concept of the X²-distributed test statistic and how to apply the tests.

@omaus started to look at the test in #181 but I think there is some sort of proper description missing for which test requires which parameters etc.

Thanks for pointing this out @matthewcrews 🚀

Activity

  1. changed the title [-]Documentation request[/-] [+]Documentation request for X² test[/+] on Sep 30, 2023
  2. github-actions commented on Apr 1, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Related to the documentation gap here: PR #362 has just been opened which fixes a concrete bug that was contributing to confusion around the χ² API — ChiSquareTest.pearsonChiSquared(table: ContingencyTable<_,_>) was a stub that always returned 42., making the independence test path completely unusable.

    Once that PR is merged, the three χ² test variants available in FSharp.Stats will all be functional:

    Test Module / Function Use case
    Goodness-of-fit ChiSquareTest.pearsonChiSquaredTest Compare observed vs. expected frequencies
    Independence (r×c) ChiSquareTest.pearsonChiSquared(table: ContingencyTable<_,_>) Test independence in a contingency table
    Independence (2×2) ChiSquareTest.pearsonChiSquared(table: Contingency2x2) Shorthand for 2×2 tables

    Linking also PR #181 which adds the Cochran–Mantel–Haenszel test for stratified 2×2 tables — that PR may be worth reviewing alongside the documentation work.

    A useful addition to the docs would be a worked example showing which function to call for each scenario (goodness-of-fit vs. independence vs. homogeneity), with a short note on degrees of freedom.

    Generated by 🌈 Repo Assist at {run-started}. Learn more.

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@1f672aef974f4246124860fc532f82fe8a93a57e
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions