Understand the idea
A table showing '60% preferred option A, 40% preferred option B' looks like it has everything needed for a chi-square test, but it is missing the single most important ingredient: how MANY people that 60%/40% split was based on. A 60/40 split from 10 people and the same split from 10,000 people are wildly different pieces of evidence, and percentages alone erase that difference completely.
The chi-square formula needs actual counts (60 and 40 out of 100; or 6,000 and 4,000 out of 10,000) so it can weigh how surprising that split would be given the sample size. Feed it percentages directly (treating '60' and '40' as if they were counts out of 100 when the real n is different) and the test statistic, degrees of freedom, and p-value are all computed against the wrong effective sample size.
Always convert back to raw counts (or keep the underlying n alongside the percentages) before running a chi-square test, and be suspicious of any report that presents only percentages with no stated sample size behind them.
A contingency table is a table of counts with one variable's categories as the rows and another's as the columns. The expected counts are the counts each cell would hold if the two variables were unrelated, and they only mean something when the table holds real counts. Running a chi-square on proportions or percentages instead of counts throws away the sample size in chi-square, which is exactly what the test needs to judge how surprising a difference is.
Practitioner explanation
The Pearson chi-square statistic sum((O-E)^2/E) and its reference chi-square distribution are calibrated against actual cell COUNTS and the total n; substituting percentages (effectively rescaling every cell to sum to 100, or to 1) silently changes n to whatever the percentages sum to, and produces a chi-square statistic and p-value that describe a fictitious sample size rather than the real one.
This error compounds with small true samples: a small, noisy underlying count can produce a percentage split that looks dramatic, and running chi-square 'on the percentages' with an implied large n (100, or whatever the percentages are normalized to) manufactures spurious significance that the real, smaller sample could never have supported.
KernelStats' chi-square cards (the chi-square test of independence and the goodness-of-fit test) take the raw categorical columns (one row per observation) and tabulate the counts themselves, so the error cannot occur inside the card as long as the raw rows are analyzed; it re-enters when a summary table of percentages is typed in as though each row were an observation, which the card cannot detect. Keep the raw data, or rebuild counts as percentage times the true n.
Common misconceptions
Misconception
You can run a chi-square test directly on a table of percentages when the raw counts are not conveniently at hand.
Correction
The chi-square test requires actual counts (and hence the real sample size) to compute expected values and the correct reference distribution correctly. Percentages alone discard exactly the information the test needs; recover the raw counts (percentage times the true n) before testing.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.15 Chi-square test for independence, NIST/SEMATECH (2012), §1.3.5.15.
