Teste Qui-quadrado
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
χ² = Σ(O-E)²/E
About this calculator
The Chi-squared test (χ²) is a statistical tool comparing observed (O) versus expected (E) frequencies in categorical data. The formula χ² = Σ(O-E)²/E quantifies the deviation between observed and expected values, weighted by their expected magnitude. It's used for goodness-of-fit tests (checking if data follows a distribution) or independence tests (analyzing relationships between categorical variables in contingency tables).
To apply the test, organize data into a frequency table. Calculate differences between observed and expected values, square them, divide by expected values, and sum the results. The chi-squared value is compared to critical values or p-values to reject the null hypothesis. Key assumptions include independent observations and no expected frequency below 5 in any category.
This test is widely used in biological, social, and marketing studies. Example: checking if gender distribution at an event differs from expected or if smoking correlates with cancer. Caution is needed when applying it to continuous data or small samples (under 20 total observations), as results may become unreliable.
Frequently asked questions
What is the chi-squared test used for?
It checks if there's a statistically significant difference between observed and expected frequencies in categorical data.
When should this test be applied?
Apply it for goodness-of-fit tests (theoretical vs real distribution) or independence between categorical variables in contingency tables.
What does a high χ² value mean?
A high value indicates greater deviation between observed and expected, suggesting the null hypothesis is likely false.
Can it be used with small samples?
Not recommended. Samples under 20 observations or expected counts below 5 in any category may produce unreliable results.