Welcome back to the AI Bayeslab Statistics series. Today, let's explore more about the relationship and differences between the chi-squared distribution and the chi-squared test:

1. What is the Chi-Squared Distribution (χ² distribution)
Definition: If X₁, X₂,..., Xₙ are independent standard normal random variables (i.e., Xᵢ ~ N(0,1)), then the sum of their squares follows a chi-squared distribution with n degrees of freedom:

X = X₁² + X₂² + ... + Xₙ² \sim χ²ₙ
Key Points:
A theoretical probability distribution.
Describes how sums of squared normal variables behave.
Used as the foundation for many statistical tests (including the chi-squared test).
2. What is the Chi-Squared Test
Definition: A statistical hypothesis test that uses the chi-squared distribution to assess:
Goodness-of-fit: Whether observed data matches an expected distribution.
Independence: Whether two categorical variables are associated.
Test Statistic: The test statistic is calculated as:

χ² = \sum \frac{(O_i - E_i)^2}{E_i}
Under the null hypothesis, this statistic follows a chi-squared distribution.
Relationship vs. Difference

Key Insight
The chi-squared test relies on the chi-squared distribution. When you perform a chi-squared test:
You calculate the test statistic X² from your categorical data.
Compare this statistic to the chi-squared distribution (with appropriate degrees of freedom) to determine statistical significance.
Example
Chi-squared test for fairness of a die:

In short:
The distribution is the mathematical "tool."
The test is the practical application of that tool to real-world data.
Stay tuned, subscribe to Bayeslab, and let everyone master the wisdom of statistics at a low cost with the AI Agent Online tool.