CChiSquaredTools module now on GitHub
Posted: Fri Dec 05, 2025 5:41 pm
Hello everyone,
Following up on my earlier posts about the chi-squared analysis module I have been developing, I am pleased to share that ChiSquaredTools is now available on GitHub:
https://github.com/gianmarcoalberti/ChiSquaredTools
I have also contacted the jamovi maintainers to request inclusion in the jamovi library.
ChiSquaredTools provides six facilities for contingency table analysis, designed with teaching in mind:
- Test of Independence — Traditional, (N−1)/N adjusted, permutation, Monte Carlo, and M test methods
- Association & Effect Sizes — Over 20 measures with confidence intervals
- Post-Hoc Analysis — Cell-level diagnostics (standardised residuals, PEM, median polish, and more)
- Row/Column Clustering — Hierarchical clustering with chi-squared distance and significance testing
- Stratified Analysis (2×2×K) — CMH test, odds ratio homogeneity tests, forest plots
- Stratified Analysis (R×C×K) — Generalised CMH and log-linear homogeneity tests
Each facility includes toggleable method explanations with formulas, rationale, and academic citations — aimed at helping students understand not just how but why.
Features not widely available elsewhere
Several aspects of this module go beyond what is typically available in standard statistical software:
Post-hoc cell-level diagnostics
The Post-Hoc Analysis facility offers a wide range of cell-level measures, many of which are difficult to find in mainstream implementations:
- Quetelet Index and IJ association factor
- Backwards-stepping outlier detection
- PEM (Percentage of Maximum Deviation) with bootstrap confidence intervals
- Median polish residuals (standardised and adjusted)
- Goodman-Kruskal residuals
- Difference in Estimated Proportions (DEP)
These allow to move beyond a simple "significant/not significant" verdict and explore which cells are driving the association.
Maximum-corrected association measures
The Association & Effect Sizes facility includes several maximum-corrected variants of standard measures — Phi corrected, Cramér's V corrected, C corrected, W-hat corrected, Sakoda's D corrected — that adjust for the theoretical maximum achievable given the marginal distributions. These are rarely implemented in off-the-shelf software but are important for comparing association strength across tables with different structures.
Hierarchical clustering with significance testing
The Row/Column Clustering facility implements Greenacre's (2017) method using Ward's algorithm with chi-squared distance. What makes it distinctive is the **significance testing** for cluster formation — the module identifies which row or column groupings are statistically justified rather than arbitrary. The dendrograms display significant merge points, helping understand when categories might legitimately be combined.
Stratified analysis with visual outputs
The Stratified Analysis (2×2×K) facility produces forest plots of stratum-specific odds ratios and a diagnostic decision tree that guides interpretation based on the CMH and homogeneity tests — useful for teaching the logic of stratified analysis.
Installation note
The pre-built `.jmo` file in the GitHub Releases was compiled on macOS and will only work on macOS systems. Windows and Linux users will need to wait for the module to appear in the jamovi library (where it will be compiled for all platforms) or build from source using `jmvtools::install()`.
Feedback welcome
I would be grateful for any feedback, bug reports, or suggestions.
Thank you to everyone who provided input during development — it has been very helpful.
Best,
Gianmarco
Following up on my earlier posts about the chi-squared analysis module I have been developing, I am pleased to share that ChiSquaredTools is now available on GitHub:
https://github.com/gianmarcoalberti/ChiSquaredTools
I have also contacted the jamovi maintainers to request inclusion in the jamovi library.
ChiSquaredTools provides six facilities for contingency table analysis, designed with teaching in mind:
- Test of Independence — Traditional, (N−1)/N adjusted, permutation, Monte Carlo, and M test methods
- Association & Effect Sizes — Over 20 measures with confidence intervals
- Post-Hoc Analysis — Cell-level diagnostics (standardised residuals, PEM, median polish, and more)
- Row/Column Clustering — Hierarchical clustering with chi-squared distance and significance testing
- Stratified Analysis (2×2×K) — CMH test, odds ratio homogeneity tests, forest plots
- Stratified Analysis (R×C×K) — Generalised CMH and log-linear homogeneity tests
Each facility includes toggleable method explanations with formulas, rationale, and academic citations — aimed at helping students understand not just how but why.
Features not widely available elsewhere
Several aspects of this module go beyond what is typically available in standard statistical software:
Post-hoc cell-level diagnostics
The Post-Hoc Analysis facility offers a wide range of cell-level measures, many of which are difficult to find in mainstream implementations:
- Quetelet Index and IJ association factor
- Backwards-stepping outlier detection
- PEM (Percentage of Maximum Deviation) with bootstrap confidence intervals
- Median polish residuals (standardised and adjusted)
- Goodman-Kruskal residuals
- Difference in Estimated Proportions (DEP)
These allow to move beyond a simple "significant/not significant" verdict and explore which cells are driving the association.
Maximum-corrected association measures
The Association & Effect Sizes facility includes several maximum-corrected variants of standard measures — Phi corrected, Cramér's V corrected, C corrected, W-hat corrected, Sakoda's D corrected — that adjust for the theoretical maximum achievable given the marginal distributions. These are rarely implemented in off-the-shelf software but are important for comparing association strength across tables with different structures.
Hierarchical clustering with significance testing
The Row/Column Clustering facility implements Greenacre's (2017) method using Ward's algorithm with chi-squared distance. What makes it distinctive is the **significance testing** for cluster formation — the module identifies which row or column groupings are statistically justified rather than arbitrary. The dendrograms display significant merge points, helping understand when categories might legitimately be combined.
Stratified analysis with visual outputs
The Stratified Analysis (2×2×K) facility produces forest plots of stratum-specific odds ratios and a diagnostic decision tree that guides interpretation based on the CMH and homogeneity tests — useful for teaching the logic of stratified analysis.
Installation note
The pre-built `.jmo` file in the GitHub Releases was compiled on macOS and will only work on macOS systems. Windows and Linux users will need to wait for the module to appear in the jamovi library (where it will be compiled for all platforms) or build from source using `jmvtools::install()`.
Feedback welcome
I would be grateful for any feedback, bug reports, or suggestions.
Thank you to everyone who provided input during development — it has been very helpful.
Best,
Gianmarco