Chi-Square Test of Independence
Test whether two categorical variables are associated using a contingency table. Get instant decision guidance with traffic light indicators, effect sizes, and business-ready interpretations.
QUICK START: Choose Your Path
DATA SOURCE
Use a Case Study
💼 Real Marketing Chi-Square Tests
Select a preset scenario to explore real-world independence tests with authentic marketing data and business context.
Load Data
Upload a contingency table
Provide a CSV/TSV where the first row lists column headers, the first column lists row labels, and every other cell contains observed counts.
Drag & Drop raw data file (.csv, .tsv, .txt, .xls, .xlsx)
Contingency table format: first row = column headers, first column = row labels, remaining cells = counts.
Upload raw data
Upload row-level observations with exactly two columns (category for variable A, category for variable B). We will aggregate them into a contingency table.
Drag & Drop raw data file (.csv, .tsv, .txt, .xls, .xlsx)
Two categorical columns with headers (Variable A, Variable B); up to 5,000 rows.
INPUTS & SETTINGS
Observed Counts
Confidence Level & Advanced Settings
Advanced settings
YOUR DECISION
Enter data to see your result
We'll calculate whether the variables are independent or associated
VISUAL OUTPUT
Stacked 100% Bar Chart
Visualization Settings
TEST RESULTS
APA-Style Statistical Reporting
Managerial Interpretation
OVERVIEW & WHAT THIS TOOL SOLVES
When you cross-tabulate two categorical variables—such as Acquisition Channel × Checkout Outcome or Customer Tier × Plan Choice—some cells always look higher or lower than average. Eyeballing row percentages cannot tell you whether the pattern is real association or random sampling chatter. The Chi-Square Test of Independence compares your observed cell counts against the counts expected if the two variables were completely unrelated, pinpointing exactly which cells drive the relationship.
🎯 Questions It Answers
- Are two categorical variables statistically independent, or does knowing a customer's row category shift their column probabilities?
- How strong is the overall association on a 0-to-1 scale (Cramér's
V)? - Which specific cells in the table are significantly over- or under-indexing (standardized Pearson residuals)?
📂 What Data You Need
- Contingency Table Mode: Raw observed frequency counts (
O_{ij}) acrossRrows andCcolumns - Raw CSV Upload: Individual customer records with two categorical columns (automatically cross-tabulated)
- Sample Adequacy: Mutually exclusive categories with expected counts ideally
E_{ij} ≥ 5
💡 What You'll Discover
- Omnibus Chi-Square Test: Pearson's
χ²statistic, degrees of freedom(R−1)(C−1), and exact p-value - Cramér's V Effect Size: Sample-size-normalized association strength with clear business benchmarks
- Cell-Level Diagnostics: Expected counts table, cell contributions to
χ², and standardized residuals
🔍 Key Nuances & Common Traps to Watch For
- Always Enter Raw Counts, Never Percentages: Rescaling a table to 100% hides whether your data came from 50 shoppers or 50,000 shoppers. Enter raw headcounts and let the tool compute row/column proportions.
- Check Expected Counts, Not Just Observed Counts: The chi-square distribution approximation relies on expected cell counts (
E_{ij} ≥ 5in at least 80% of cells). When cells are sparse, merge rare categories. - Inspect Cell Residuals After a Significant Result: An omnibus
p < 0.05tells you somewhere in the table departs from independence; cells with standardized residuals beyond±1.96reveal which specific segment × outcome pairings are driving the effect.
📐 Under the Hood: Model Equations & Variable Definitions
1. Independence Expected Counts & Pearson Chi-Square Statistic
💬 Read it in plain English: For every cell, we calculate the count expected if row and column traits were independent (row total × column total ÷ grand total), then sum the squared gaps between observed and expected counts relative to expected size.
2. Cramér's V Effect Size & Standardized Cell Residual
💬 Read it in plain English: Cramér's V scales the chi-square statistic by sample size N and table dimensions onto a 0-to-1 scale, while the standardized residual r_{ij} acts like a cell-level z-score showing which cells over- or under-perform.
DIAGNOSTICS & ASSUMPTIONS
Diagnostics & Assumption Tests
Enter observed counts to check sample size, expected counts, and leverage diagnostics.
Expected Counts
What are expected counts?
Under the null hypothesis (independence), the expected count for each cell is what we would anticipate from the row and column totals alone. These expected values are used in the chi-square statistic by comparing observed and expected counts and summing the squared differences scaled by the expected value: χ² = Σi,j (Oij − Eij)²Eij. When many expected counts are small (e.g., < 5), results should be interpreted with caution.