DoesWhatAnswersSlangEmojisCalculatorsTriviaPlayBlog

Trivia Questions and Weird Facts

Math

What Is a Chi Square Test?

Short answerA chi square test compares the counts you actually observed with the counts you would expect if nothing interesting were going on. If the gap is big enough, the difference is probably real. It works on categories and counts, like yes or no answers, not on averages.

What does a chi square test actually do?

The short answer is that it measures how far your data drifts from the boring explanation. You count things in categories, work out what those counts should look like if everything were random or evenly split, then compare the two.

The test gives you a single number. Small number, your data looks like chance. Big number, something else is probably going on. A p value then tells you how often chance alone would produce a gap that big. People usually call it significant when p is under 0.05, which means chance would pull this off less than 5 percent of the time.

What is the chi square formula?

It looks scary and is not:

Chi square equals the sum of (observed minus expected) squared, divided by expected.

You do that little calculation for every category, then add them all up. Squaring stops positive and negative gaps from canceling out, and dividing by the expected count keeps big categories from bullying small ones.

Can you show a chi square test example?

Say you flip a coin 100 times and get 60 heads, 40 tails. A fair coin should give 50 and 50.

ResultObservedExpected(O minus E) squared / E
Heads6050100 / 50 = 2
Tails4050100 / 50 = 2

Add them up and your chi square is 4. With one degree of freedom, that sits around p equals 0.045, just under the usual cutoff. So this coin is suspicious, but only barely. Run it another hundred times before you accuse anyone.

When should you not use it?

Chi square wants counts of separate categories, not measurements like height or time. It also gets unreliable when expected counts drop below about 5, which is why tiny studies should use a different test. And if your data is paired, like the same people measured twice, look elsewhere.

One fun bit of history: the test comes from Karl Pearson in 1900, and the name is just Greek for the letter X, because the statistic was written with the Greek chi symbol.

Do the math: open the chi square calculator

Keep going