In short
Degrees of freedom (df) are the number of values that are free to vary once you have estimated what the test needs from the data. Each estimated quantity costs one. That is why a one-sample or paired t test has n − 1, an independent-samples t test has n1 + n2 − 2, a one-way ANOVA has k − 1 and N − k, a correlation has N − 2 and a chi-square test of independence has (rows − 1)(columns − 1). In APA 7 they go in parentheses right after the statistic: t(48), F(2, 117), r(98), χ²(3, N = 210). Because they are a function of the sample size, they are also the fastest check on a paper: F(2, 117) from three groups means 120 people were analyzed, whatever the abstract says.
Degrees of freedom are the small numbers in brackets that most people copy from the output without reading. They matter for two reasons. First, the same t value means different things with different df: t = 2.10 gives p = .041 with 48 degrees of freedom and p = .062 with 10. Second, they are a direct trace of how many observations entered each analysis, which makes them one of the best tools for checking a manuscript, your own or someone else's. Here is the intuition, the df of each common test, the APA format, the cases where they are not whole numbers and the errors reviewers catch with them.
What degrees of freedom are, before any formula
Suppose five scores have a mean of 10. You can choose the first four freely: 8, 12, 9 and 11. The fifth is no longer free: it has to be 10 for the mean to come out at 10. Five values, one constraint, four degrees of freedom. That is the whole idea. Every time a statistic uses a quantity estimated from the same data (a mean, a regression coefficient, a row total), that quantity imposes a constraint and costs one degree of freedom.
It is also why the sample variance divides by n − 1 rather than n. The deviations are measured from the sample mean, which was estimated from those same scores, so only n − 1 of them carry independent information. Dividing by n would underestimate the population variance, systematically.
In practice the df tell the test which reference distribution to use. A t distribution with 5 df has heavy tails, because the standard deviation in the denominator is estimated from very little; with 200 df it is almost indistinguishable from the normal. That is why the df change the p value for the same statistic, and why a p value cannot be checked unless they are reported.
The degrees of freedom of each test
| Test | Degrees of freedom | Example |
|---|---|---|
| One-sample t | n − 1 | 40 people: t(39) |
| Paired t | number of pairs − 1 | 60 people measured twice: t(59) |
| Independent t (Student) | n1 + n2 − 2 | 25 + 25: t(48) |
| One-way ANOVA | k − 1 and N − k | 3 groups, 120 people: F(2, 117) |
| Factorial ANOVA, a × b | effect: a − 1, b − 1 or (a − 1)(b − 1); error: N − ab | 2 × 3, 120 people, interaction: F(2, 114) |
| Repeated measures ANOVA | k − 1 and (k − 1)(n − 1) | 3 time points, 50 people: F(2, 98) |
| Pearson correlation | N − 2 | 100 people: r(98) |
| Multiple regression, overall test | p and N − p − 1 | 3 predictors, 150 people: F(3, 146) |
| Regression coefficient | N − p − 1 | same model: t(146) |
| Chi-square of independence | (r − 1)(c − 1) | 2 × 4 table: χ²(3, N = 210) |
| Chi-square goodness of fit | categories − 1 (minus any estimated parameters) | 4 categories: χ²(3, N = 210) |
Two things stand out. The chi-square df depend on the shape of the table, not on the sample size, which is why APA asks you to add N inside the parentheses. And in an F the first df describes the effect while the second describes the error term; the second is the one that carries the sample size.
Where they go in APA 7
The degrees of freedom go in parentheses immediately after the statistic, with no space, in roman type: t(48) = 2.10, p = .041. An F carries two, separated by a comma and a space: F(2, 117) = 4.12, p = .019. A correlation can carry its df the same way, r(98) = .32, p = .001, or give N in the text instead. A chi-square carries its df and the sample size: χ²(3, N = 210) = 8.43, p = .038. The statistic symbols in Latin letters are italicized; χ² is Greek and stays upright.
Whole-number df are written as integers. Fractional df, which appear in the cases below, are kept fractional, usually with two decimals: t(67.94), not t(68). Rounding them hides the correction you applied. The full t test format is in how to report a t test in APA 7.
Fractional df: Welch, Greenhouse-Geisser and mixed models
Welch's t test. When the two groups have different variances, Welch's test estimates the standard error from each group separately and approximates the df with the Welch-Satterthwaite formula (Satterthwaite, 1946). With 45 people (SD = 10.40) and 71 people (SD = 6.80), Student's test would have 114 df; Welch's has 67.94. The df shrink most when the larger variance sits in the smaller group.
Greenhouse-Geisser. In repeated measures, when sphericity fails, both df are multiplied by the estimated epsilon (Greenhouse & Geisser, 1959). With three time points, 50 people and ε = .71, F(2, 98) becomes F(1.42, 69.58). The F value does not change; its p value does: F = 4.50 gives p = .013 uncorrected and p = .025 corrected. A corrected p printed next to uncorrected df is a common inconsistency. The details are in how to report Mauchly's test of sphericity.
Linear mixed models. Here there is no exact df for the fixed effects, and software approximates them. lmerTest in R and the MIXED procedure in SPSS use the Satterthwaite approximation by default; the Kenward-Roger method (Kenward & Roger, 1997) is the other common choice in small samples. Say which one you used, because they give different df and slightly different p values for the same model.
How to use the df to check a paper's N
Because the df are a function of the sample, you can run them backwards. This is the check I run first on any Results section, and it needs nothing but the paper.
- Independent t(48): 50 people analyzed. If the Method says 56 and nobody explains the other six, there is missing data the paper has not declared.
- One-way F(2, 109) with three groups: N − 3 = 109, so 112 people. If 120 were randomized, the eight missing need a sentence and, in a trial, a flow diagram.
- r(98): 100 people. If the correlation table says N = 100 but one cell carries r(91), that pair had missing values and the table should say pairwise deletion was used.
- Regression F(3, 140) with three predictors: 144 people, not the 150 in the descriptives.
- Paired t(118) with 60 participants: the df are those of an independent test (60 + 60 − 2). The data were probably analyzed as if the two measurements came from different people, which is the wrong test, not just the wrong df.
The second step is to check that the p value matches the statistic and its df, which is what statcheck automates for APA-formatted results (Nuijten et al., 2016). Both checks are explained step by step in degrees of freedom that do not match the N and a p value that does not match its df. Neither proves misconduct: almost always the explanation is missing data, exclusions or a copied row. But they are exactly where an unreported decision shows up. If a paper has several of these signals at once, the broader method is in how to tell if a paper's statistics are made up.
The df errors reviewers find most often
An F with one df. “F = 4.12, p = .019” cannot be recomputed. Every F has two.
A chi-square without N, or with df that do not match the table: a 2 × 3 table has (2 − 1)(3 − 1) = 2 df, not 5 and not N − 1.
Reporting N where the df go. t(50) for 50 people in two groups should be t(48).
Whole-number df after a correction. Welch or Greenhouse-Geisser applied and then rounded to integers, or the corrected p printed with the uncorrected df.
The same N everywhere. When every test carries the full sample's df but the descriptives show missing values, either the missing data were imputed (and the Method should say how) or the df were not read from the output.
Frequently asked questions
What are degrees of freedom in simple terms?
The number of values that are still free to vary after you have estimated what the test needs from the same data. Each estimated quantity, such as a mean or a regression coefficient, imposes one constraint and costs one degree of freedom. Five scores with a known mean have four degrees of freedom.
How do you calculate degrees of freedom for a t test?
For a one-sample or paired t test, n − 1 (in a paired test, n is the number of pairs). For an independent-samples t test with equal variances assumed, n1 + n2 − 2. For Welch's t test, the Welch-Satterthwaite approximation, which usually gives a fractional value that should be reported as it is, for example t(67.94).
How do you report degrees of freedom in APA 7?
In parentheses right after the statistic, in roman type: t(48) = 2.10, p = .041; F(2, 117) = 4.12, p = .019; r(98) = .32, p = .001. A chi-square carries its df and the sample size: χ²(3, N = 210) = 8.43, p = .038. Fractional df are kept fractional, usually to two decimals.
Why are my degrees of freedom not a whole number?
Because a correction or an approximation was applied: Welch's t test or Welch's ANOVA for unequal variances, the Greenhouse-Geisser or Huynh-Feldt correction for sphericity, or the Satterthwaite or Kenward-Roger approximation in a mixed model. It is correct, and you should report the fractional value rather than round it.
Can I work out the sample size from the degrees of freedom?
Yes, and it is a useful check. An independent t(48) means 50 people; an F(2, 117) in a one-way ANOVA with three groups means 120; r(98) means 100. If the number does not match the sample described in the Method, some cases were excluded or missing, and the paper should explain it.
Do the degrees of freedom in your Results add up to your sample?
It takes a reviewer seconds to run the arithmetic backwards. Previum runs it on every test in the manuscript, together with the p value against its df.
Run your paper through Previum →Read the degrees of freedom as part of the result, not decoration: they say which test was run, on how many people and with which correction. When the numbers do not add up and you cannot tell why, or the design makes the df hard to work out (multilevel data, imputation, unbalanced repeated measures), that is what my statistical consulting is for.
References
Greenhouse, S. W., & Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24(2), 95–112. https://doi.org/10.1007/BF02289823
Kenward, M. G., & Roger, J. H. (1997). Small sample inference for fixed effects from restricted maximum likelihood. Biometrics, 53(3), 983–997. https://doi.org/10.2307/2533558
Nuijten, M. B., Hartgerink, C. H. J., van Assen, M. A. L. M., Epskamp, S., & Wicherts, J. M. (2016). The prevalence of statistical reporting errors in psychology (1985–2013). Behavior Research Methods, 48(4), 1205–1226. https://doi.org/10.3758/s13428-015-0664-2
Satterthwaite, F. E. (1946). An approximate distribution of estimates of variance components. Biometrics Bulletin, 2(6), 110–114. https://doi.org/10.2307/3002019