Run a chi-square test on a table of counts CHI-SQUARE
Paste a contingency table, or two columns of categories, and see whether the rows and columns are related: expected counts, chi-square, degrees of freedom, p and Cramér's V, with a warning when the counts are too small for the test.
The test
The counts
The result
For the write-up
How it works
CHI-SQUARE also runs Fisher's exact test and Yates's correction on a two-by-two table, shows adjusted residuals so you can see which cells drive the result, and tests counts against expected shares for goodness of fit. Every figure is held to SciPy, and nothing typed here leaves this tab.
What it does, and what it does not
The test of independence asks whether the pattern in a table of counts, say smokers and non-smokers by region, is more uneven than chance would make it if the two had nothing to do with each other. It works out the count each cell would have if they were unrelated, adds up how far the real counts are from those, and reads p from the chi-square distribution. The adjusted residual in each cell is how many standard errors that cell is from its expected count; beyond about 2 either way is where the association lives.
The test needs counts of separate people or things, each counted once. It is not for percentages, means or measurements, and not for the same people counted twice (before and after needs McNemar's test, which this page does not run). Fisher's exact test is given only for two-by-two tables; a larger table with small expected counts needs categories combined, or an exact test this page does not offer. Nothing corrects for running many tests.
The likelihood-ratio chi-square (G) is shown as well, since some fields report it. Every figure, including Fisher's exact p, is held to SciPy in this site's own tests. For scores rather than counts, T-TEST compares two means.
Doing this often? OBSCURA Research crosstabulates any two variables of a .sav, CSV or Excel file and runs chi-square on them, with the output saved to Word or PDF. On its own, US$2 a month; with everything else, US$5 a month or US$48 a year. 7 days free.