Hypothesis Tests
Degrees of Freedom Calculator
Degrees of freedom are the count of independent pieces left after a design spends estimates, and this page returns that count.
Worksheet
Press Calculate to see the result.
Degrees of freedom are the count of independent pieces left after a design spends estimates, and this page returns that count.
What this calculator answers
Degrees of freedom are what a design has left after it spends estimates. A one-sample mean spends one, a line spends two, and a Welch comparison spends a fractional amount that depends on the two variances. This page is a design switch: you pick the layout, and only the boxes that layout needs are read. It returns df and stops. It does not compute a t, an F, or a p-value, because those need the data rather than the headcount. The Welch option uses the Satterthwaite approximation, which is the same fractional df the Welch t test will later use.
The headline is the error degrees of freedom for the design you picked. Designs with a numerator and a denominator also list the numerator df beside it. Supporting counts and intermediate terms sit under the headline so a reader can see what was divided by what. When a checkbox or a tail setting changes the divisor or the rejection region, that choice appears in the steps rather than vanishing into a silent default.
The formula, written out
Design degrees of freedom uses this relationship.
One sample and paired: n-1. Equal variance: n1+n2-2. Welch: Satterthwaite. Between ANOVA: N-k and k-1. Repeated measures: (n-1)(k-1). Table: (r-1)(c-1). Goodness of fit: k-1. Slope: n-predictors-1.
- n. Sample size, pairs, subjects, or regression rows.
- n1 and n2. The two group sizes.
- s1 and s2. Sample standard deviations used only by Welch.
- k, N, rows, cols, predictors. The extra counts the other designs spend.
Each estimated parameter consumes one independent piece. Welch cannot spend a whole number, because the standard error mixes two sample variances, so Satterthwaite approximates the df of that mixture as (s1 squared over n1 plus s2 squared over n2) squared, divided by the sum of each squared term over its own n minus 1. The algebra is the named textbook identity for this worksheet. Intermediate products and quotients appear in order so a calculator and a pencil can agree to the displayed rounding. If a neighbouring page uses a different divisor or a continuity correction, that page says so on its own ticket.
A full worked example
Example loaded in the worksheet
The loaded design is one-sample with n equal to 30. The other boxes are filled so a design switch still has numbers.
The design is one-sample and n is 30. The estimate of the mean spends 1 degree of freedom. Degrees of freedom are n minus 1, which is 30 minus 1.
That equals 29. The two-sample boxes, the ANOVA boxes, and the table boxes were not read for this design. This page returns df only. It does not return a p-value for these 30 observations.
A z test with known sigma would not spend this df. The t curve is the one that uses 29. Welch df is a different formula and needs two standard deviations. It was not used for this one-sample count.
| Degrees of freedom | 29 |
|---|---|
| n | 30 |
A second situation
Welch design using s1, n1, s2, and n2
Welch df uses n1 equal to 16, s1 equal to 4.2, n2 equal to 12, and s2 equal to 6.1. The first variance term is s1 squared over n1, which equals 1.1025. The second variance term is s2 squared over n2, which equals 3.1008.
Satterthwaite df is (u1 plus u2) squared, divided by u1 squared over (n1 minus 1) plus u2 squared over (n2 minus 1). The numerator is 17.668 and the denominator is 0.9551. The quotient is 18.4978.
Equal-variance df would have been 26, and this page did not return that number as the answer. No p-value is computed. The Welch t-test page is where this df meets a t statistic.
| Degrees of freedom | 18.4978 |
|---|---|
| Equal-variance df | 26 |
The second example leaves the one-sample count and computes the Welch fraction from the standard deviations that were sitting unused. That fraction is not n1 plus n2 minus 2, which is the point of having a separate design. The second example changes the feature that this formula is sensitive to, and the ticket shows the new figure beside the same definition. That contrast is the fastest way to see which input owns the movement.
What moves when the input moves
The one-sample n moved from 30 to 40. The design stayed one-sample. The headline result went from 29 to 39.
The nudged inputs
The design is one-sample and n is 40. The estimate of the mean spends 1 degree of freedom. Degrees of freedom are n minus 1, which is 40 minus 1.
That equals 39. The two-sample boxes, the ANOVA boxes, and the table boxes were not read for this design. This page returns df only. It does not return a p-value for these 40 observations.
A z test with known sigma would not spend this df. The t curve is the one that uses 39. Welch df is a different formula and needs two standard deviations. It was not used for this one-sample count.
| Degrees of freedom | 39 |
|---|---|
| n | 40 |
How to read the result
Use the headline df as the df of the reference curve for that design. When two df values appear, the first is the error df and the second is the numerator df of an F or the companion count. Say the unit, the sample size or contract terms, and the formula name in the same sentence as the figure. A number without those three pieces invites a later reader to invent a definition that this page never used.
Name the design and the df together. A df of 29 could be a one-sample of 30 or a regression with a different n, and those are not the same curve in context. Write the result with its unit, the inputs that produced it, and the name of the formula. If the ticket shows a decision sentence, quote the alpha and the tail with it. If the ticket shows a money or dose figure, quote the rate and the schedule that produced it.
Assumptions that have to stay true
- The design you picked is the one that generated the statistic you will look up.
- Counts are whole numbers in the roles that are counts.
- Welch standard deviations are sample standard deviations, not variances, and not both zero.
- Goodness-of-fit df here is categories minus 1, which assumes the expected probabilities were fully specified rather than estimated from the same data.
If an assumption above is false, do not average the discomfort away. Change the worksheet or change the question. A correct arithmetic step on the wrong model is still the wrong answer for the decision you are trying to make.
Mistakes that change the answer
- Using n as df for a one-sample t. The mean spends one.
- Pooling df as n1 plus n2 minus 2 after you have already decided the variances differ.
- Using rows times columns for a contingency table.
- Forgetting the intercept in a regression and writing n minus predictors.
Where a different calculator is the honest choice
The one-sample t-test calculator and Welch's t-test calculator spend these df inside a test. The ANOVA calculator returns F and a p-value, not df alone. Stay here when the only question is the count. Related links under the essay open pages that keep their own formulas instead of hiding a mode switch inside this ticket.
When the job changes, move to a page built for that job: One Sample T-Test Calculator, Welch's T-Test Calculator, ANOVA Calculator.
Check yourself
A one-sample test has 30 observations. How many degrees of freedom does the mean leave?
The degrees of freedom are 30 minus 1, which is 29.
Using the result in a sentence
Students checking a t table, and analysts confirming a software printout, both need the df before they trust a p-value. The Welch fraction is the case that is easiest to mis-copy by hand. Keep the count, the unit, and the assumption list beside any copy of the number that leaves this browser tab.
A correct df does not make a wrong test wise. The page also uses the fully specified goodness-of-fit count, so estimated parameters would need a smaller df than the one shown for that design. Pair the headline with the steps before you staff a route, set a grade boundary, or compare two contracts from a single number.
Questions people ask next
01What definition does the Degrees of Freedom Calculator commit to?
This page uses Design degrees of freedom: One sample and paired: n-1. Equal variance: n1+n2-2. Welch: Satterthwaite. Between ANOVA: N-k and k-1. Repeated measures: (n-1)(k-1). Table: (r-1)(c-1). Goodness of fit: k-1. Slope: n-predictors-1.. Each estimated parameter consumes one independent piece. Welch cannot spend a whole number, because the standard error mixes two sample variances, so Satterthwaite approximates the df of that mixture as (s1 squared over n1 plus s2 squared over n2) squared, divided by the sum of each squared term over its own n minus 1. If a textbook uses a different divisor, a different continuity correction, or a different rounding rule, the last digits can move, so the definition is printed above the result. The worksheet asks for Design, n, n1, n2, s1, s2, and related inputs, and it refuses a blank that the formula cannot interpret. Keep that printed definition in the sentence you write next to the figure so a later reader can rebuild the arithmetic without guessing which convention you chose.
02How should the worked example be read out loud?
In the loaded example the degrees of freedom is 29. Use the headline df as the df of the reference curve for that design. When two df values appear, the first is the error df and the second is the numerator df of an F or the companion count. Say the unit and the count before you say whether the number is large or small. Read the steps in order rather than jumping to the headline, because the intermediate terms are where a swapped percent and proportion usually hide. If the ticket shows both a primary figure and a comparison figure, name which one you are quoting.
03What is the fastest way to get a misleading result?
Using n as df for a one-sample t. The mean spends one. A correct df does not make a wrong test wise. The page also uses the fully specified goodness-of-fit count, so estimated parameters would need a smaller df than the one shown for that design. A second common failure is leaving a checkbox or tail setting in the wrong state and then treating the number as if the default had matched your plan. Reset the example, change one input, and confirm the ticket moves in the direction the formula predicts before you trust a live run.
04When should I leave this page for a different calculator?
The one-sample t-test calculator and Welch's t-test calculator spend these df inside a test. The ANOVA calculator returns F and a p-value, not df alone. Stay here when the only question is the count. The related links under the essay go to those worksheets, which keep their own formulas instead of hiding them in a mode switch. If the question changed from a summary to a test, from a payment to a refinance, or from a raw score to a percentile, switch pages rather than forcing this ticket to answer a job it was not built for.
05What belongs in the sentence next to the number?
The degrees of freedom are 30 minus 1, which is 29. Name the design and the df together. A df of 29 could be a one-sample of 30 or a regression with a different n, and those are not the same curve in context. A bare number without those three pieces cannot be audited when a score, a rate, or a lab value is challenged later. Store the inputs beside the result whenever the figure will travel into a report.