Page 1 of 1

ChiSquaredTools v1.0.0 – Comprehensive Chi-Squared Testing, Post-Hoc Analysis & Association Measures

Posted: Thu Nov 20, 2025 3:59 pm
by GmA
Hello everyone,

Following on from my earlier post (viewtopic.php?t=4082) where I shared a preliminary version of the ChiSquaredTools module, I wanted to update the community on its development.

The module has expanded considerably beyond the initial post-hoc facility, and I would welcome feedback from anyone willing to test it.

Current Facilities

The module now provides three fully integrated analysis components:
1. Chi-Squared Testing Facility (chisqtest)

- Traditional χ² test
- (N-1)/N adjusted test (Williams' correction)
- Permutation test with (optional) distribution visualisation
- Monte Carlo test with (optional) distribution visualisation
- Automated method selection guidance based on table characteristics (grand total, minimum expected frequencies, table dimensions)
- Supports both long-format (case-level) and wide-format (aggregated with counts variable) data[/list]

2. Post-Hoc Analysis Facility (chisqposthoc)

-Standardised residuals
-Moment-corrected standardised residuals (Garcia-Perez & Nunez-Anton 2003)
-Adjusted standardised residuals (Haberman 1973)
-Quetelet Index (Mirkin 2001, 2023)
-IJ Association Factor (Good 1956; Agresti 2013)
-PEM (Percentage of Maximum deviation) with bootstrap confidence intervals (Cibois 1993; Lefèvre & Champely 2009)
-Standardised median polish residuals
-Adjusted standardised median polish residuals
-Optional Šidák correction for multiple comparisons with dynamically calculated thresholds
-Colour-coded significance indicators (red for positive associations, blue for negative)
-Individual interpretive guidance for each measure with threshold explanations and references

3. Association Measures Facility (chisqassoc)
Chi-squared-based measures:
-φ coefficient (phi) with signed and corrected versions
-Contingency coefficient C with adjusted and corrected versions
-Cramér's V with confidence intervals (Smithson 2003)
-Cramér's V corrected (Berry et al. 2018)
-Cramér's V standardised (Smith 1976; Reynold 1977)
-Cramér's V bias-corrected (Bergsma 2013)
-Cohen's w
-χ²-max table calculation and display with ratio interpretations

Distance-based measures:
-W-hat coefficient (Ŵ) with bootstrap confidence intervals (Kvålseth 2018)

Margin-free measures (2×2 tables):
-Yule's Q with confidence intervals and p-values
-Yule's Y with confidence intervals and p-values
-Odds Ratio with confidence intervals and p-values
-Pairwise comparisons for all 2×2 sub-tables in larger tables

Proportional Reduction in Error (PRE) measures:
-Goodman-Kruskal Lambda (rows dependent, columns dependent, symmetric) with confidence intervals
-Lambda corrected versions
-Goodman-Kruskal Tau (rows dependent, columns dependent) with confidence intervals

Supplementary displays:
-Standardised contingency table (rescaled to average marginal totals)
-Chi-squared-maximising table for understanding upper bounds
-Effect size thresholds table with two-tier interpretation system (Cohen 1988; Olivier-Bell 2013)

Educational Orientation
The module has been designed specifically with pedagogical aims. All three facilities include optional comprehensive method explanations that can be toggled on/off by the user, including (but not limited to):

Detailed method descriptions for each coefficient/measure explaining:
What the measure calculates and why
Its range and interpretation
When it is appropriate or problematic
How corrections address specific limitations
Appropriate use cases

Effect size interpretation guidance:
Two-tier threshold system accounting for table dimensions and marginal configurations
Specific references for each threshold (Cohen 1988, Ferguson 2009, empirical guidelines from literature)
Clear magnitude labels (Small, Medium, Large)

Academic references provided for every statistical method, properly formatted with author-year citations

I remain grateful to those who downloaded and presumably tested earlier versions (253+ downloads).
For anyone interested in testing, the updated (zipped) .jmo file is attached.

Best regards,
Gianmarco

Re: ChiSquaredTools v1.0.0 – Comprehensive Chi-Squared Testing, Post-Hoc Analysis & Association Measures

Posted: Fri Nov 21, 2025 6:41 pm
by vinschger
thank you very much for your module. I have sideloaded it and try to better understand how it can be used.
maybe you have a sample file that shows the main features of your module that you would be willing to share?

Re: ChiSquaredTools v1.0.0 – Comprehensive Chi-Squared Testing, Post-Hoc Analysis & Association Measures

Posted: Fri Nov 21, 2025 7:28 pm
by GmA
Thank you for your interest and for taking the time to test the module!

I have attached a simple sample dataset (ChiSquaredTools_SampleData.csv) that demonstrates the module's main features. The data represent survival counts by passenger class (a subset of the well-known Titanic data).


LOADING THE DATA

1. Download the attached CSV file
2. In jamovi, go to File → Open and select the CSV file
3. Ensure that Class and Survived are recognised as nominal variables (right-click column header → Data Type → Nominal Text)


VARIABLE ASSIGNMENT (same for all three facilities)

- Row Variable: Class
- Column Variable: Survived
- Counts: Freq (essential — the data are in aggregated format)


————————————————————————————————
FACILITY 1: TEST OF INDEPENDENCE (chisqtest)
————————————————————————————————

This facility provides four testing methods:

- Traditional χ² test: Standard Pearson chi-squared test
- (N-1)/N Adjusted test: Williams' correction for small samples
- Permutation test: Distribution-free test with empirical null distribution
- Monte Carlo test: Simulation-based test for sparse tables

Features to explore:

- Show method selection guidance: Provides automated recommendations based on table characteristics (grand total, minimum expected frequencies, table dimensions)
- Show distribution plots: Visualises the permutation and Monte Carlo null distributions with the observed statistic marked
- Show detailed method explanations: Methodological background with references for each test


————————————————————————————————
FACILITY 2: POST-HOC ANALYSIS (chisqposthoc)
————————————————————————————————

This facility identifies which specific cells drive the overall chi-squared result. Eight cell-level measures are available:

- Standardised Residuals: Basic (O-E)/√E residuals

- Moment-Corrected Standardised Residuals: Improved variance estimation (Garcia-Perez & Nunez-Anton 2003)

- Adjusted Standardised Residuals: Accounts for marginal variation (Haberman 1973)

- Quetelet Index: Proportional deviation from independence (Mirkin 2001, 2023)

- IJ Association Factor: Multiplicative departure measure (Good 1956; Agresti 2013)

- PEM: Percentage of Maximum deviation with bootstrap confidence intervals (Cibois 1993; Lefèvre & Champely 2009)

- Standardised Median Polish Residuals: Robust residuals using median polish

- Adjusted Standardised Median Polish Residuals: Margin-adjusted robust residuals

Features to explore:

- Apply Šidák correction: Adjusts significance thresholds for multiple comparisons; the dynamically calculated threshold is displayed in the interpretive notes
- Colour-coded cells: Red indicates significant positive associations (attraction), blue indicates significant negative associations (repulsion)
- Show significance summary tables: Lists all significant positive, significant negative, and non-significant cell combinations
- Show detailed method explanations: Individual interpretive guidance for each measure with threshold explanations and references


————————————————————————————————
FACILITY 3: ASSOCIATION & EFFECT SIZES (chisqassoc)
————————————————————————————————

This facility computes association measures organised into four families:


CHI-SQUARED-BASED MEASURES

- φ (Phi): Basic chi-squared-based measure for 2×2 tables
- φ signed: Phi with directional sign preserved
- φ corrected: Maximum-corrected Phi
- Contingency Coefficient C: Bounded measure based on χ²
- C adjusted: Adjusted for table dimensions
- C corrected: Maximum-corrected C
- Cramér's V: Standardised measure with confidence intervals (Smithson 2003)
- Cramér's V corrected: Maximum-corrected (Berry et al. 2018)
- Cramér's V standardised: Based on standardised table (Smith 1976; Reynolds 1977)
- Cramér's V bias-corrected: Small-sample correction (Bergsma 2013)
- Cohen's w: Effect size measure for chi-squared


DISTANCE-BASED MEASURES

- W-hat (Ŵ): Distance-based coefficient with bootstrap confidence intervals (Kvålseth 2018)
- Sakoda's D_G: Normalised distance measure


MARGIN-FREE MEASURES (2×2 tables or pairwise comparisons)

- Yule's Q: Association measure bounded [-1, +1] with confidence intervals and p-values
- Yule's Y: Colligation coefficient with confidence intervals and p-values
- Odds Ratio: Ratio of odds with confidence intervals and p-values

For tables larger than 2×2, these margin-free measures are computed for all pairwise 2×2 sub-tables.


PRE (PROPORTIONAL REDUCTION IN ERROR) MEASURES

- Goodman-Kruskal Lambda: Asymmetric (rows→cols, cols→rows) and symmetric versions with confidence intervals
- Lambda corrected: Corrected versions
- Goodman-Kruskal Tau: Asymmetric measure with confidence intervals


Features to explore:

- Show effect size threshold table: Displays two-tier interpretation system — standard Cohen (1988) thresholds alongside table-adjusted thresholds accounting for dimensions and marginal configurations
- Show chi-square-maximising table: Displays the theoretical maximum-association table for your marginals, helping interpret how close your observed association is to the upper bound (used to compute maximum-corrected version of Phi and Cramer V)
- Show standardised table: Table rescaled to average marginal totals, removing marginal effects (used to compute V standarsided)
- Show detailed method explanations: Comprehensive methodological notes for all selected measures


————————————————————————————————
WHAT YOU SHOULD OBSERVE
————————————————————————————————

The Class × Survived relationship shows clear patterns: first-class passengers had notably higher survival rates, whilst third-class and crew had lower rates. This makes the colour-coded significance indicators and effect size interpretations particularly meaningful for demonstration purposes.

If you have questions about specific features or encounter any issues, please let me know.

Best regards,
Gianmarco


p.s.
The Sadoka index is part of the current (still provisional) version I am working one as I type this reply.

Re: ChiSquaredTools v1.0.0 – Comprehensive Chi-Squared Testing, Post-Hoc Analysis & Association Measures

Posted: Fri Nov 21, 2025 8:58 pm
by GmA
Hello,
i just realized that there is a bug when dealing with data in wide format. Will look up into it later. Please, for the time being, use this instead.

GmA

Re: ChiSquaredTools v1.0.0 – Comprehensive Chi-Squared Testing, Post-Hoc Analysis & Association Measures

Posted: Sat Nov 22, 2025 3:25 pm
by vinschger
Probably I am doing anything wrong, but distribution plots seem not to work, yet?!

Re: ChiSquaredTools v1.0.0 – Comprehensive Chi-Squared Testing, Post-Hoc Analysis & Association Measures

Posted: Sat Nov 22, 2025 4:21 pm
by GmA
hello,
have you selected either the Permutation or MonteCarlo version of the chi2 test first?