Categorical association tester
Open Categorical association tester on Happytails.ai. This view has the same page content and links, with explicit tool capabilities. Read the processing notes before using a tool.
Tool capabilities
{
"id": "categorical-association-tester",
"category": "calculators",
"built": true,
"requirements": "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).",
"implementation": {
"fields": [
{
"key": "inputMode",
"label": "Data",
"value": "table",
"type": "select",
"values": [
"table",
"raw"
],
"labels": {
"table": "Counts table (first column holds row labels)",
"raw": "Raw rows with two category columns"
}
},
{
"key": "rowColumn",
"label": "Row category column",
"value": "row",
"type": "text",
"maxLength": 200,
"help": "Exact header of the first category column.",
"showWhen": {
"inputMode": [
"raw"
]
}
},
{
"key": "columnColumn",
"label": "Column category column",
"value": "column",
"type": "text",
"maxLength": 200,
"help": "Exact header of the second category column.",
"showWhen": {
"inputMode": [
"raw"
]
}
},
{
"key": "test",
"label": "Test",
"value": "association",
"type": "select",
"values": [
"association",
"mcnemar"
],
"labels": {
"association": "Association (chi-square, G and Fisher)",
"mcnemar": "McNemar for paired yes/no outcomes (2 x 2)"
}
},
{
"key": "yates",
"label": "Yates continuity correction for 2 x 2 tables",
"value": true,
"type": "checkbox"
},
{
"key": "fisher",
"label": "Fisher exact test",
"value": "auto",
"type": "select",
"values": [
"auto",
"exact-2x2",
"exact-rxc",
"monte-carlo",
"none"
],
"labels": {
"auto": "Automatic: exact when possible, Monte Carlo for large tables",
"exact-2x2": "Exact 2 x 2 with odds ratio interval",
"exact-rxc": "Exact for any table size (small tables only)",
"monte-carlo": "Seeded Monte Carlo",
"none": "Do not run"
},
"showWhen": {
"test": [
"association"
]
}
},
{
"key": "replicates",
"label": "Monte Carlo replicates",
"value": "2000",
"type": "text",
"maxLength": 200,
"help": "Whole number from 100 to 10,000.",
"showWhen": {
"test": [
"association"
],
"fisher": [
"auto",
"monte-carlo"
]
}
},
{
"key": "seed",
"label": "Monte Carlo seed",
"value": "happytails",
"type": "text",
"maxLength": 100,
"help": "Any text of 1 to 100 characters. The same seed gives the same p-value.",
"showWhen": {
"test": [
"association"
],
"fisher": [
"auto",
"monte-carlo"
]
}
},
{
"key": "confidence",
"label": "Confidence level for the 2 x 2 odds ratio",
"value": "0.95",
"type": "text",
"maxLength": 200,
"help": "A proportion from 0.5 to 0.9999.",
"showWhen": {
"test": [
"association"
]
}
}
],
"registrationFamily": "statistical-comparison-tests",
"inputMaxLength": 1000000,
"inputErrorCode": "STATISTICAL_COMPARISON_TESTS_TOO_LONG",
"note": "Runs on your device in the background. Paste a counts table up to 20 x 20 or up to 10,000 raw rows, at most 1,000,000 characters.",
"experience": {
"automatic": false,
"single": false,
"inputMaxLength": 1000000,
"inputMode": "text",
"label": "Counts table or raw CSV",
"placeholder": "label,category A,category B",
"help": "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.",
"helpParts": [
"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."
],
"action": null
},
"mode": "explicit",
"interactive": false
},
"execution": "Browser interface",
"api": null,
"browser_agent": {
"supported": true,
"name": "run_current_tool",
"discovery": "WebMCP on the human page in a supporting browser",
"verification": "See audit/API-AUDIT.md; availability is not verification"
}
}Page guide
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.
How to use Categorical association tester
- Paste a counts table with row labels in the first column, or raw rows with two category columns.
- Choose the association test or McNemar for paired yes/no outcomes.
- Pick how the Fisher test runs, and a seed if Monte Carlo is used.
- 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.