Why is df a decimal on a two-sample t-test?
By Jude Wallis · Published
Nothing is wrong with what you typed. A two-sample t-test gets its degrees of freedom from the Welch-Satterthwaite formula, which mixes both groups' variances and sample sizes and almost never lands on a whole number. Report the technology value. By hand, use the smaller of n1 - 1 and n2 - 1.
AP Statistics: Unit 4 (topics 4.9 Setting Up a Test for the Difference Between Two Population Means, 4.10 Carrying Out a Test for the Difference Between Two Population Means). Two-sample t procedures sit in Unit 4 (topics 4.9 and 4.10) of the Fall 2026 AP Statistics course, where the degrees of freedom fall between the smaller of n1 - 1 and n2 - 1 and the value n1 + n2 - 2 and you find them with technology.
The short answer: a decimal df is correct
You did not mistype a sample size. A two-sample t-test computes its degrees of freedom with the Welch-Satterthwaite formula, and that formula almost never returns a whole number. A calculator reporting is doing exactly what it was built to do.
The decimal feels wrong because every other df in this course is a count of something. A one-sample t-test uses . A paired t-test uses on the column of differences. A chi-square test counts categories: for goodness of fit, for a two-way table. All whole numbers. The two-sample t-test is the one place in AP Statistics where df stops being a count and becomes a setting that picks the shape of a curve, and shape settings have no reason to be integers.
Two facts cover the practical question. Report the df your technology gives you, decimal and all. If you are working by hand from a t-table, use the conservative df: the smaller of and .
Where the decimal comes from
The standard error for a difference of two means keeps the groups apart:
Each group hands over its own estimated variance, and , computed from its own sample. That is the whole source of the decimal. The t curve you need depends on how precisely has been estimated, and here it is estimated from two samples that can differ in size and in spread. One integer cannot describe that mixture.
The Welch-Satterthwaite formula finds the t curve that matches the mixture:
Read it as a weighted average in disguise. When one group's term dominates the standard error, the df slides down toward that group's , because that group's uncertainty is running the show. When the two terms contribute evenly, the df climbs toward the combined total. Nothing in that arithmetic is forced to land on an integer.
A t curve with is a real curve, not an approximation to a nearby integer one. The t density is defined for any positive df through the gamma function, which extends factorials to non-integer inputs, so software computes a p-value from it directly. You are not asked to evaluate the Welch formula by hand on the AP exam. You are asked to recognize the number and use it.
The df has to land between two numbers, so use that as a typo check
The Welch df always sits inside a fixed window:
That window is the fastest way to confirm you entered the data correctly. Suppose and . The floor is and the ceiling is . A reported falls inside, so the entry is fine. A reported or would mean a sample size or a standard deviation really did get typed wrong.
The two ends also explain why some examples never show a decimal at all. The df reaches its ceiling of when the groups contribute in proportion, which happens when . Equal sample sizes with equal sample standard deviations is the familiar case, so a textbook example built from tidy matched numbers can hand you a whole-number df and hide the issue completely. At the other end, the df drops to near the smaller when one small group carries most of the standard error.
Why your calculator and the board work disagree
There are three df values in circulation for two independent means, and your teacher was almost certainly using a different one from your calculator.
| Route | df it gives | Where you meet it |
|---|---|---|
| Welch, from technology | a decimal, such as 17.34 | TI-84 2-SampTTest with Pooled: No, and most software |
| Conservative, by hand | smaller of and | board work and homework done from a t-table |
| Pooled | TI-84 with Pooled: Yes, and older textbooks |
The pooled route assumes the two populations have the same standard deviation, then combines both samples into one estimate of it. That assumption buys back a whole-number df, and it is why shows up so often. The AP formula sheet lists only the unpooled standard error for means, the version above, so on this exam you choose Pooled: No and live with the decimal. That setting gets its own walkthrough in pooled or not on a two-sample t-test.
The conservative route is the honest by-hand substitute. Using the smaller gives a t curve with tails at least as heavy as the true one, so the p-value comes out at least as large as the exact value. It can never make your evidence look stronger than it is. That is the trade: a bit of power lost, no risk of overstating the result.
What to report, and what not to round
Report the df you actually used, right next to your test statistic and p-value. That single habit removes the confusion for whoever reads your work, since means different things at and .
Do not round the df before finding the p-value if your technology can use the exact value. If a table forces you onto a whole-number row, round down, never up. Rounding down keeps the tails a little heavier and the p-value a little larger. Rounding up thins the tails and shrinks the p-value below the truth, which is the one direction you cannot afford.
Here is what the choice actually costs. Every row holds the same from the worked example below, so the table isolates what the df alone does:
| df used | Two-sided p-value |
|---|---|
| 8 (conservative) | 0.033 |
| 17 (rounded down) | 0.020 |
| 17.34 (Welch) | 0.020 |
| 18 (rounded up) | 0.019 |
| 29 (the ceiling, ) | 0.016 |
Rounding down costs almost nothing, and the conservative df is noticeably more cautious. A bigger df thins the tails and shrinks the p-value, which is why the bottom row is the smallest number in the column.
That bottom row is not a pooled test. Pooling changes the standard error as well as the df, so it never just slides you down this table. Run the same battery data pooled and you get , , , and at , which is larger than the Welch 0.020, not smaller. Pooling is not reliably generous and not reliably safe either: it assumes the two populations share one standard deviation, and when that assumption fails the p-value can move either way. It comes out too small when the smaller sample is the more variable one. That is why the AP formula sheet lists only the unpooled standard error. You can check any of these against the two-sample t-test calculator, and see how the output is laid out in reading calculator output.
Mistakes to avoid
- Do not round a decimal df up to reach a table row. Round down, or let technology use the exact value.
- Do not pair the unpooled standard error with . Those belong to different procedures, and the mismatch reports a p-value that is too small.
- Do not read the df as a count of data values. With and you have 31 observations and a df of 17.34, and both are correct at once.
- Do not run a two-sample test on paired data. Before-and-after measurements on the same subjects collapse to one column of differences with , a whole number again. See paired vs two-sample t-test.
- Do not report the calculator's df and then look up a critical value at some other df. Keep the p-value, the interval, and the stated df on the same curve.
- Do not panic at a df of 17.34 and switch to a z-test. The reason for using t has not changed: is unknown for both groups. See t-test vs z-test.
Where df = 17.34 comes from, digit by digit
Independent random samples of AA batteries are tested for lifetime in hours. Brand A: , , . Brand B: , , . Neither sample shows strong skewness or outliers. Find the standard error, the Welch degrees of freedom, the t statistic, and the two-sided p-value for .
Conditions: two independent random samples, each well under 10% of its brand's production, and neither sample shows strong skewness or outliers, so two-sample t procedures apply.
Group A term: .
Group B term: .
Standard error: hours.
Welch numerator: square the sum from the last step, .
Welch denominator, first piece: .
Welch denominator, second piece: .
Add the two pieces: .
Degrees of freedom: .
Check the window: the smaller of and is 8, and . Since , the value is legitimate and the data were entered correctly.
Test statistic: .
Two-sided p-value from technology at : .
hours, , , and . The decimal is the Welch value, and it passes the check. At the 0.05 level you reject : there is convincing evidence that the mean lifetimes of the two battery brands differ.
The same test by hand, with the conservative df
Take the battery data above, with and hours, and suppose no calculator is available. Test at using a t-table, then build a 95% confidence interval for .
Conditions carry over from the example above: independent random samples, each under 10% of its brand's production, no strong skewness or outliers.
Conservative df: the smaller of and , so use .
Read row 8 of the t-table. The 95% column (total tail area 0.05) gives , and the 98% column (total tail area 0.02) gives .
Place your statistic: sits between 2.306 and 2.896, so the two-sided p-value is between 0.02 and 0.05.
Decide: is below because exceeds the 0.05 critical value 2.306, so reject . Technology at would report .
Conservative interval: , giving hours.
Welch interval for comparison, using and : , giving hours.
Compare the two routes: the conservative df gives the larger p-value (0.033 against 0.020) and the wider interval, every time.
With the t-table gives , so you reject at the 0.05 level, and the 95% interval is hours. The Welch route gives and . Same conclusion, with the by-hand version deliberately more cautious.
Frequently asked questions
Is a decimal df a sign that I entered something wrong?
No. The Welch-Satterthwaite formula returns a non-integer for almost every data set. Check it against the window instead: the df must fall between the smaller of and and the value . If it does, your entry is fine.
Should I round 17.34 to 17 or to 18?
Neither, if your technology can use 17.34 directly. If a table forces a whole number, round down to 17. Rounding down keeps the tails heavier and the p-value slightly larger. Rounding up to 18 shrinks the p-value below its true value, in this example to 0.019 instead of 0.020.
Why isn't the df just $n_1 + n_2 - 2$?
That is the pooled df, and it requires assuming both populations have the same standard deviation. The AP formula sheet gives only the unpooled standard error, which estimates each group's spread separately, so the matching df is the Welch value. It is never larger than .
Which df should I use on the AP exam?
The course expects you to find the df with technology, so use the value your calculator reports and write it down with your test statistic and p-value. If you are working from a table instead, use the conservative df, the smaller of and , and state that you did.