Chi-Square Test of Independence

Crosstab tool

Explore whether two categorical variables are associated using a contingency table. Enter the observed counts below; we compute expected counts, χ², df, p-value, and an interpretation.

Use this tool to determine whether the distribution of one categorical variable differs across the levels of another. In marketing, this helps validate whether response rates shift across creative, channel, or audience slices.

Chi-square statistic: $$\chi^2 = \sum_{i=1}^{r} \sum_{j=1}^{c} \frac{(O_{ij} - E_{ij})^2}{E_{ij}}$$

Expected cell count: $$E_{ij} = \frac{(\text{Row}_i \text{ total})(\text{Col}_j \text{ total})}{\text{Grand total}}$$

Additional notes

Chi-square approximations are most reliable when each expected count exceeds 5. When sparse cells remain, consider combining categories or switching to an exact or simulation-based procedure.

MARKETING SCENARIOS

Pick a scenario to auto-fill the contingency table and narrative with real marketing counts from curated analyses. Switch back to manual inputs if you want to customize the numbers further.

INPUTS & SETTINGS

Select Data Entry / Upload Mode

Design your table

Observed Counts

Shows a small label under each input.

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)

Contingency table format: first row = column headers, first column = row labels, remaining cells = counts.

No contingency table uploaded yet.

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)

Two categorical columns with headers (Variable A, Variable B); up to 2,000 rows.

No raw file uploaded yet.

Confidence Level & Advanced Settings

Advanced settings
Options for special cases and small samples.
Use for small-sample 2×2 tables to reduce bias.

VISUAL OUTPUT

Stacked 100% Bar Chart

Visualization Settings
Bars show 100% stacked proportions by the chosen X variable.

Reverse the stacking so the bottom segment moves to the top.

TEST RESULTS

Chi-square (χ²):
Degrees of freedom:
p-value (upper tail):
Effect size (Cramér's V):
Decision (α):
Interpretation:

APA-Style Statistical Reporting

Managerial Interpretation

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 − EijEij. When many expected counts are small (e.g., < 5), results should be interpreted with caution.