CChiSquaredTools module now on GitHub

Everything related to the development of modules in jamovi
Post Reply
GmA
Posts: 32
Joined: Wed Mar 19, 2025 3:23 pm

CChiSquaredTools module now on GitHub

Post by GmA »

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
User avatar
vinschger
Posts: 51
Joined: Tue Jun 03, 2025 8:27 pm

Re: CChiSquaredTools module now on GitHub

Post by vinschger »

If I side load the chisquaredtools_1.0.0.jmo from your github page, I first get the message, that the module has successfully been installed, but it is now showing up in the menu bar afterwards. After going to the installed modules section, I see the module there, but with a warning, that it has to be updated. The only option I can click there is the remove button.
Attachments
CleanShot 2025-12-05 at 19.55.09@2x.png
CleanShot 2025-12-05 at 19.55.09@2x.png (263.36 KiB) Viewed 4282 times
GmA
Posts: 32
Joined: Wed Mar 19, 2025 3:23 pm

Re: CChiSquaredTools module now on GitHub

Post by GmA »

Hello,
maybe this can help understand the issue. I am copying/pasting from the ReadMe document on GitHub:

Pre-built module (macOS only):

Download the .jmo file from the Releases page
In jamovi, go to Modules → jamovi library → Sideload (⋮ menu)
Select the downloaded .jmo file

⚠️ Note: The pre-built .jmo file was compiled on macOS and will only work on macOS systems. Windows and Linux users will need to build the module from source using jmvtools::install() in R, or wait for the module to become available in the jamovi library.
User avatar
vinschger
Posts: 51
Joined: Tue Jun 03, 2025 8:27 pm

Re: CChiSquaredTools module now on GitHub

Post by vinschger »

I have installed it exactly as described there, I am on MacOS (Silicone).
GmA
Posts: 32
Joined: Wed Mar 19, 2025 3:23 pm

Re: CChiSquaredTools module now on GitHub

Post by GmA »

uhmmm...that's interesting.... :-(
I will try to see what going on, but i cant reproduce the issue on my device...
GmA
Posts: 32
Joined: Wed Mar 19, 2025 3:23 pm

Re: CChiSquaredTools module now on GitHub

Post by GmA »

Could you please confirm your exact jamovi version? You can find this by opening jamovi and looking at the version number displayed on the welcome screen, or via the About menu.
My module was built against jamovi 2.6.45, so if you are running jamovi 2.7.x, that would explain the incompatibility.
User avatar
vinschger
Posts: 51
Joined: Tue Jun 03, 2025 8:27 pm

Re: CChiSquaredTools module now on GitHub

Post by vinschger »

yes, I am running jamovi 2.7.13.
Post Reply