Skip to content

Categorical Data Lab

Edit the counts or drag the tile boundaries: the mosaic, the expected frequencies and χ² follow. Under independence every column of tiles would line up. Then scale N: the percentages stay, but χ² and p change while Cramér's V does not.

Mosaic plot

width = row share, height = column share within the row; colour = adjusted standardised residual

628844106WomenMenTrusts parliamDoes not
Mosaic plot: Women (150): Trusts parliament 62, Does not 88; Men (150): Trusts parliament 44, Does not 106. χ² = 4.73, p .030, V = 0.126

more than expected fewer than expected

Table: Observed

Total
150
150
Total106194300

χ² contributions (O − E)²/E per cell

1.53WomenTrusts0.84WomenDoes n1.53MenTrusts0.84MenDoes n
χ² contributions (O − E)²/E per cell: χ² = 4.727

Pearson χ² without continuity correction (the SPSS 'Pearson Chi-Square' row); Yates and Fisher's exact test are shown for 2×2 tables. Expected counts below 5 in more than 20 % of cells (or any below 1) trigger the sparse-table warning, as in SPSS footnotes. Preset tables are synthetic.

χ² = 4.73, p .030, V = 0.126

Formula

E_ij = (row_i · col_j) / Nχ² = Σ (O − E)² / Edf = (R−1)(C−1)V = √(χ² / (N · min(R−1, C−1)))

χ² grows in proportion to N at fixed percentages: significance is about sample size as much as association. V is the size of the association, independent of N.

Method: Pearson χ² without continuity correction (SPSS 'Pearson Chi-Square'); Yates reported separately for 2×2 · Synthetic, seeded data. Illustrative, not an empirical finding.

Validation: χ², p, V, Fisher and OR match the SciPy/statsmodels reference (tests/unit/engine.test.ts) · numerically validated