Degrees of Freedom Calculator
Calculate degrees of freedom for t-tests, chi-square tables, one-way ANOVA, and multiple linear regression with the correct formula.
About degrees of freedom
Degrees of freedom examples
| Test and input | Degrees of freedom | Calculation |
|---|---|---|
| One-sample t-test, n = 25 | df = 24 | Subtract one estimated mean from the sample size. |
| Chi-square table, 4 rows by 3 columns | df = 6 | (4 - 1)(3 - 1) = 6. |
| One-way ANOVA, 4 groups and 40 observations | Between = 3; within = 36 | Use k - 1 and N - k for the two components. |
How to calculate degrees of freedom
- Select the statistical test that matches your planned analysis.
- Enter the requested sample size, table dimensions, group count, or predictor count.
- Select Calculate degrees of freedom to apply the formula for that test.
- Use the result with the correct statistical reference distribution or report it beside the test statistic.
Degrees of freedom FAQ
Why do we subtract one from a sample size?
Estimating the sample mean creates one constraint because deviations from that mean must sum to zero. Once n - 1 deviations are known, the final deviation is determined.
Can degrees of freedom be a decimal?
The common formulas in this calculator produce whole numbers. Approximate procedures such as the Welch-Satterthwaite equation can produce fractional degrees of freedom.
Which t-test option should I use for unequal variances?
Do not use the pooled two-sample formula when the analysis uses Welch's t-test. Welch's method calculates an approximate df from both sample variances and sizes.
What are ANOVA within-group degrees of freedom?
Within-group degrees of freedom measure information available for estimating unexplained variation inside groups. For one-way ANOVA, the value is total observations minus the number of groups.
Why must regression residual df be positive?
Residual variation can only be estimated when observations remain after fitting every slope and the intercept. A nonpositive value indicates that the model has too many parameters for the available data.