Chi-square Test Statistic

The chi-square test statistic is a number you calculate from observed and expected counts in a contingency table. In Intro to Statistics, it is used to test whether two categorical variables look independent or related.

Last updated July 2026

What is the Chi-square Test Statistic?

The chi-square test statistic is the value you compute when you want to compare what you actually observed in a table to what you would expect if the null hypothesis were true. In Intro to Statistics, that usually means working with counts in a contingency table, not means, medians, or percentages.

The basic idea is simple: if the observed counts are very close to the expected counts, the chi-square statistic stays small. If the counts are far apart, the statistic gets larger. The formula adds up (OE)2/E(O-E)^2/E across all cells, where O is the observed frequency and E is the expected frequency. Squaring the difference makes positive and negative gaps count the same, and dividing by the expected count keeps the measure scaled to the size of the category.

You usually meet this statistic in a chi-square test of independence. That test asks whether two categorical variables are independent, like whether favorite coffee type is related to class year. First you build a contingency table from the data. Then you find expected counts using row totals, column totals, and the grand total. After that, you compute the chi-square test statistic from every cell in the table.

A bigger chi-square statistic means the observed table is more different from what independence would predict. That does not automatically mean the variables are related in a meaningful way, though. It just means the evidence against the null hypothesis is stronger, and you still need the p-value and the chosen level of significance to make a decision.

The degrees of freedom matter too because they shape the reference distribution used to find the p-value. For an r by c table, the degrees of freedom are (r1)(c1)(r-1)(c-1). So a 2 by 3 table has 2 degrees of freedom, while a 3 by 3 table has 4. In practice, this statistic is the middle step between raw counts and the final conclusion about independence.

Why the Chi-square Test Statistic matters in Intro to Statistics

The chi-square test statistic is the number that turns a contingency table into a hypothesis test. Without it, you just have counts. With it, you can check whether the pattern in the table is bigger than what random chance would reasonably produce.

That matters any time the course asks about categorical data. You might compare survey responses, study whether two traits appear connected, or analyze a data table from a lab or class project. The test statistic gives you a single value that summarizes how much the observed data disagree with the independence model.

It also teaches a core statistics habit: compare observed data to a model, not just to your intuition. A table can look uneven at first glance, but the chi-square calculation shows whether that unevenness is actually large relative to the expected counts. That is why the formula uses expected frequencies, not percentages or raw differences alone.

This term also connects the calculation to interpretation. A large chi-square value often leads to a small p-value, but you still have to read the result in context. In an intro stats class, that usually means stating whether you have enough evidence to say the variables are associated, then backing that claim up with the table and the test result. It is one of the clearest examples of how statistical reasoning moves from data to decision.

Keep studying Intro to Statistics Unit 11

How the Chi-square Test Statistic connects across the course

Contingency Table

The chi-square test statistic starts with a contingency table, since that is where the observed counts live. You need the row totals, column totals, and grand total from the table to find expected counts for each cell before you can calculate the statistic.

Degrees of Freedom

Degrees of freedom tell you which chi-square distribution to compare your statistic against. For a contingency table, the formula is (r1)(c1)(r-1)(c-1), so the table size changes the shape of the distribution and the p-value you get.

Hypothesis Testing

The chi-square test statistic is part of the full hypothesis testing process. You compute the statistic from the data, use it to find a p-value, and then decide whether there is enough evidence to reject independence between the variables.

Cramer's V

The chi-square test statistic tells you whether there is evidence of an association, while Cramer's V helps describe how strong that association is. A significant chi-square result does not tell you the size of the relationship by itself.

Is the Chi-square Test Statistic on the Intro to Statistics exam?

A quiz or problem set item will usually give you a contingency table and ask you to calculate the chi-square test statistic, find degrees of freedom, and interpret the result. You may also need to identify the expected counts first, since the statistic depends on comparing observed and expected values cell by cell.

When you answer, show the setup clearly: compute each expected count, plug each pair into (OE)2/E(O-E)^2/E, and add the results. If the question includes a p-value or significance level, the final sentence should say whether you reject or fail to reject the null hypothesis of independence. On written work, teachers often want the interpretation in plain language, like whether the variables appear related in the sample data.

The Chi-square Test Statistic vs p-value

The chi-square test statistic is the calculated number from your table, while the p-value tells you how unusual that statistic is if the null hypothesis is true. You use the statistic to get the p-value, then use the p-value to make the decision about independence.

Key things to remember about the Chi-square Test Statistic

  • The chi-square test statistic compares observed counts to expected counts in a contingency table.

  • You calculate it by adding up (OE)2/E(O-E)^2/E for every cell, so bigger gaps produce a larger statistic.

  • A larger chi-square value means the data are farther from what independence would predict.

  • The statistic by itself does not give the final conclusion, because you still need the degrees of freedom and p-value.

  • In Intro to Statistics, this statistic usually shows up in tests of independence for categorical variables.

Frequently asked questions about the Chi-square Test Statistic

What is chi-square test statistic in Intro to Statistics?

It is the number you get when you compare observed counts to expected counts in a contingency table. In Intro to Statistics, it is used to test whether two categorical variables are independent or associated.

How do you calculate the chi-square test statistic?

First find the expected count for each cell, usually from the row total, column total, and grand total. Then compute (OE)2/E(O-E)^2/E for each cell and add all the values together.

What does a large chi-square test statistic mean?

A large value means the observed table is farther from the expected table than you would expect by chance if the variables were independent. That usually leads to a smaller p-value and stronger evidence against the null hypothesis.

Is chi-square test statistic the same as the p-value?

No. The chi-square test statistic is the calculated measure of difference between observed and expected counts. The p-value comes from that statistic and tells you how likely a result that extreme would be if the null hypothesis were true.