happytails.ai

Categorical association tester

Test association in a contingency table up to 20 x 20 with Pearson chi-square, Yates, the G test and Cramer's V, with expected-count checks and residuals. Fisher's exact test covers 2 x 2 tables and small larger tables, with a seeded Monte Carlo version for the rest, and McNemar's test covers paired yes/no data.

Runs locally in your browser in a background worker; nothing is uploaded. CSV up to 1,000,000 characters. Counts tables have 2 to 20 rows and 2 to 20 count columns, whole-number counts and unique row labels; raw data has up to 10,000 rows and 2 to 20 categories per column, with labels of at most 80 characters. McNemar's test needs a 2 x 2 table. Exact r x c enumeration allows at most 100,000 observations and 10,000,000 search steps. Monte Carlo uses 100 to 10,000 replicates and at most 100,000 observations, with observations times replicates at most 50,000,000. Confidence level 0.5 to 0.9999. Setting numbers are plain decimals with a digit before the point, such as 0.95, without exponents. In CSV with two or more columns a blank line between rows is rejected, and in one-column CSV it is a blank cell; blank lines after the last row are ignored. Downloads: a JSON report and CSV tables (tests, observed, expected and residuals). Paste counts with row labels in the first column, or raw rows with two category columns. Up to 1,000,000 characters. Review the settings before running.

Your result

Report a problem or share an idea.

How to use Categorical association tester
  1. Paste a counts table with row labels in the first column, or raw rows with two category columns.
  2. Choose the association test or McNemar for paired yes/no outcomes.
  3. Pick how the Fisher test runs, and a seed if Monte Carlo is used.
  4. Run the tests, check the expected counts and residuals, and download the report.

Useful next steps

Chi-square and G tests

Pearson's chi-square compares observed counts with the counts expected under independence (Pearson 1900). For 2 x 2 tables the Yates correction is applied by R's rule (Yates 1934, Journal of the Royal Statistical Society Supplement 1:217). The G test is the likelihood-ratio version. Cramer's V scales chi-square to 0 to 1, and adjusted standardized residuals show which cells drive the result (Agresti 2013, Categorical Data Analysis, 3rd ed., section 2.4). Expected counts below 5 make the chi-square p-value unreliable and are flagged.

Fisher exact test

For 2 x 2 tables the exact test follows R fisher.test, with the conditional maximum likelihood odds ratio and its exact interval. For larger tables the exact p-value adds the probability of every table with the same row and column totals that is no more likely than the observed one (Freeman and Halton 1951, Biometrika 38:141), up to 10,000,000 search steps. Automatic mode always runs the exact test for 2 x 2 tables. For larger tables it runs the exact enumeration when an expected count is below 5, and falls back to the seeded Monte Carlo estimate (1 + hits)/(B + 1), as R simulate.p.value, when the table is too large.

McNemar test

For paired yes/no outcomes in a 2 x 2 table, McNemar's test uses the two discordant cells (McNemar 1947, Psychometrika 12:153), with an optional continuity correction and the exact binomial p-value.

Limits

Each observation must be counted once and independently. Association is not causation, and a small p-value in a large table says nothing about which categories matter without the residuals.