Chi-Square Distribution Calculator
Calculate p-value from chi-square statistic.
Please enter a valid chi-square value (must be >= 0)
Enter χ² value and degrees of freedom
What Is the Chi-Square Distribution?
The chi-square (χ²) distribution arises when you sum squared standard normal variables. It's fundamental to tests of independence, goodness of fit, and variance comparisons.
Key parameter: Degrees of freedom (df)
Properties:
- Always non-negative (sum of squares)
- Right-skewed (more so for small df)
- Mean = df
- Variance = 2 × df
From χ² Statistic to P-Value
This calculator converts a chi-square statistic to a p-value:
Example: χ² = 12.5, df = 5 P-value = P(χ² > 12.5) = 0.029
Since this is less than 0.05, the result is statistically significant.
Applications
Chi-Square Test of Independence
"Is there an association between two categorical variables?"
| Outcome A | Outcome B | |
|---|---|---|
| Group 1 | 30 | 70 |
| Group 2 | 50 | 50 |
χ² measures the discrepancy between observed and expected counts. df = (rows - 1) × (columns - 1) = 1
Chi-Square Goodness of Fit
"Does observed data match expected proportions?"
Example: Testing if a die is fair. df = categories - 1 = 5
Variance Testing
"Is the population variance equal to a hypothesized value?"
Confidence Interval for Variance
The chi-square distribution provides critical values for variance confidence intervals.
Distribution Shape
The chi-square distribution changes with df:
| df | Shape |
|---|---|
| 1-2 | Highly right-skewed, mode at 0 |
| 3-5 | Right-skewed |
| 10+ | More symmetric, approaching normal |
| 30+ | Nearly normal, mean = df |
As df increases, the distribution becomes more symmetric and approaches normal.
Critical Values
For α = 0.05 (right-tail probability):
| df | χ² critical |
|---|---|
| 1 | 3.84 |
| 2 | 5.99 |
| 5 | 11.07 |
| 10 | 18.31 |
| 20 | 31.41 |
| 30 | 43.77 |
The Inverse Chi-Square Calculator finds critical values for any df and probability.
Historical Development
The chi-square distribution emerged from work by several statisticians:
Friedrich Helmert (1876) first derived the distribution of the sum of squared normal variables in the context of measurement errors.
Karl Pearson (1900) developed the chi-square test for goodness of fit, one of the first formal statistical tests. His test for contingency tables revolutionized the analysis of categorical data.
Ronald Fisher extended the theory, clarifying degrees of freedom and developing related tests.
The name "chi-square" comes from the Greek letter χ (chi), used by Pearson in his notation.
Mathematical Definition
If are independent standard normal variables:
The sum of k squared standard normals follows .
This explains why χ² is always non-negative and right-skewed.
Relationship to Other Distributions
Normal: Sum of squared standard normals → χ²
T-distribution: T² ~ F(1, df), and T = Z/√(χ²/df)
F-distribution: F = (χ₁²/df₁) / (χ₂²/df₂)
Gamma: χ²(k) = Gamma(k/2, 2)
Exponential: χ²(2) is exponential with mean 2
Chi-Square and Sample Variance
For a sample from a normal distribution:
This relationship underlies:
- Confidence intervals for variance
- Tests comparing variance to a hypothesized value
- F-tests comparing two variances
Degrees of Freedom in Practice
Goodness of fit: df = categories - 1 - estimated parameters
Independence test: df = (rows - 1) × (columns - 1)
Variance test: df = n - 1
The Degrees of Freedom Calculator helps determine df for various tests.
Assumptions for Chi-Square Tests
For contingency tables:
- Expected cell counts ≥ 5 (traditional rule)
- Independent observations
- Random sampling
When expected counts are small:
- Use Fisher's exact test (2×2 tables)
- Combine categories if possible
- Use exact multinomial tests
For variance tests:
- Data from normal distribution
- Random sampling
Chi-square tests for variance are sensitive to non-normality.
Computing P-Values
The chi-square CDF has no closed form—it's computed via:
- Incomplete gamma function
- Numerical integration
- Series approximations
For large df, normal approximation works: χ² ≈ Normal(df, √(2×df))
One-Tailed vs. Two-Tailed
Chi-square tests are typically one-tailed (right-tail):
- Test statistic measures deviation from expected
- Only large χ² values indicate significant departure
For variance tests, two-tailed tests use both tails:
- Lower tail: variance too small?
- Upper tail: variance too large?
Related Calculations
- Inverse Chi-Square Calculator — Find critical χ² values
- Chi-Square Test of Independence — Test for association
- Chi-Square Goodness of Fit — Test observed vs. expected
- Degrees of Freedom Calculator — Calculate df
- Variance Calculator — Sample variance
Summary
The chi-square distribution—the sum of squared standard normal variables—is fundamental to categorical data analysis and variance inference. Tests of independence, goodness of fit, and variance hypotheses all rely on chi-square p-values. The distribution is parameterized by degrees of freedom, which determine its shape from highly skewed (small df) to nearly normal (large df). Understanding the chi-square distribution enables proper interpretation of contingency table analyses and variance tests across many fields.