InsightFab
Knowledge Base/Chi-squared Test: Hypothesis Testing for Count Data
6 Sigma7 min read

Chi-squared Test: Hypothesis Testing for Count Data

When dealing with count data such as defect quantities, yield rate comparisons, or production line disparities, a t-test is inappropriate. The Chi-squared Test is a standard statistical tool for analyzing categorical and count data, and this article outlines its three common applications.

Scenario

You have three production lines and want to know if there's a significant difference in their defect rates. Line A has 8 defective items out of 200, Line B has 14 defective items out of 200, and Line C has 6 defective items out of 200. Use a t-test? No, this is count data, not continuous data.

What is the Chi-squared Test?

The Chi-squared (χ²) test is used to analyze relationships between categorical data (Count Data), answering the question:

"Is there a significant difference between the observed data distribution and the expected distribution?"

Three main usages:

Usage One: Goodness of Fit

Question: Does the data distribution conform to the expected proportions?

Example: A product has three grades: A, B, and C, with theoretical proportions of 50%:30%:20%. If 200 units were actually produced, do the proportions match?

H₀: The actual distribution conforms to the expected proportions.

H₁: The actual distribution does not conform to the expected proportions.

Usage Two: Test of Independence

Question: Is there an association between two categorical variables?

Example: Is there a relationship between defect type (out-of-tolerance dimensions, cosmetic defects, functional abnormalities) and production shift (morning shift, night shift)?

Create a Contingency Table:

Out-of-ToleranceCosmetic DefectFunctional AnomalyTotal
Morning Shift128525
Night Shift615425
Total1823950

H₀: Defect type and shift are independent.

H₁: Defect type and shift are associated.

Usage Three: Test of Homogeneity

Question: Are the categorical distributions of multiple groups the same?

Example: Are the defect rates of the three production lines the same? (This is the question from the scenario above.)

Interpreting Results

  • P < 0.05: Reject H₀, indicating a significant difference or association.
  • P ≥ 0.05: Fail to reject H₀, meaning the observed difference may be due to random chance.

Prerequisites for Use

ConditionDescription
Expected count in each cell ≥ 5If not met, combine categories or use Fisher's exact test.
Independent samplesThe same sample cannot appear in multiple cells.
Categorical dataNot applicable to continuous data (use t-test or ANOVA).

Golden Quote

"When your data involves counting units, not measuring dimensions, Chi-squared is your tool."

Want to try it yourself?

Every tool mentioned in this article is available on InsightFab — just upload a CSV to analyze.

Go to Tools