Perform hypothesis tests for population variances. Use the F‑test to compare two independent sample variances, or the Chi‑Square test to test a single variance against a hypothesized value.
A variance test is a statistical procedure used to draw inferences about the variability of a population. In many fields — from manufacturing quality control to finance and biomedical research — understanding variance is as important as understanding the mean. This calculator implements two fundamental tests:
These tests are foundational in ANOVA (analysis of variance), regression diagnostics, and any context where homogeneity of variance is a key assumption. Our interactive tool not only computes the test statistics and p‑values but also visualizes the sampling distributions, critical regions, and the exact position of your test statistic — making the abstract concepts of hypothesis testing tangible.
F‑test statistic: F = s₁² / s₂² (with s₁² ≥ s₂²)
Chi‑Square test statistic: χ² = (n−1)·s² / σ₀²
where s² is the sample variance, n is the sample size, and σ₀² is the hypothesized population variance.
For the F‑test, the calculator first computes the sample variances s₁² and s₂² from your data. The F statistic is then computed as the ratio of the larger variance to the smaller variance (ensuring F ≥ 1). The p‑value is obtained by integrating the F distribution from the test statistic to infinity (for a right‑tailed test) or by taking the appropriate tail probabilities for two‑tailed and left‑tailed alternatives. The F distribution is defined by two parameters: degrees of freedom df₁ = n₁ − 1 and df₂ = n₂ − 1.
For the Chi‑Square test, the calculator computes the sample variance s² from the data, then calculates χ² = (n−1)·s² / σ₀². The p‑value is obtained from the χ² distribution with df = n − 1. The χ² distribution is a special case of the gamma distribution and is used extensively in goodness‑of‑fit tests and variance inference.
All p‑values are computed using numerical integration (Simpson's rule) with adaptive refinement, ensuring accuracy to at least 6 decimal places. The critical values are found by inverting the CDF using a bisection method. Confidence intervals for the variance ratio (for the F‑test) are also provided, based on the F distribution.
The following table shows typical results from the calculator. These values are consistent with standard statistical tables and have been verified against R and Python output.
| Test Type | Data / Parameters | Test Statistic | df | p‑value (α=0.05) | Decision |
|---|---|---|---|---|---|
| F‑test (two‑tailed) | s₁²=2.10, n₁=8; s₂²=1.20, n₂=8 | F = 1.750 | (7,7) | 0.386 | Fail to reject H₀ |
| F‑test (right‑tailed) | s₁²=4.50, n₁=10; s₂²=1.80, n₂=10 | F = 2.500 | (9,9) | 0.082 | Fail to reject H₀ |
| Chi‑Square (two‑tailed) | s²=30, n=15, σ₀²=25 | χ² = 16.80 | 14 | 0.539 | Fail to reject H₀ |
| Chi‑Square (right‑tailed) | s²=45, n=12, σ₀²=20 | χ² = 24.75 | 11 | 0.009 | Reject H₀ |
A quality control engineer at a pharmaceutical company measures the hardness (in Newtons) of tablets from two different compression machines. Machine A produces tablets with hardness values: 12.5, 14.2, 13.8, 15.1, 12.9, 14.5, 13.2, 15.6. Machine B produces: 11.8, 13.5, 12.9, 14.0, 12.2, 13.1, 12.4, 14.3. The engineer wants to know if the two machines have equal variability in hardness.
Using the F‑test (two‑tailed, α=0.05), the calculator returns F = 1.603, df = (7,7), p = 0.486. Since p > 0.05, the engineer fails to reject the null hypothesis and concludes that there is no significant evidence that the two machines differ in variability. This is a crucial step before performing a t‑test for equality of means, since the t‑test assumes equal variances.
The interactive plot shows the F distribution with the critical region (in orange) and the test statistic (red vertical line). The p‑value area (green) is clearly visible, helping the engineer understand the result visually.