Tests whether the mean of a sample differs from an assumed population mean μ₀. It calculates t = (sample mean − μ₀) ÷ (sample standard deviation ÷ √n) and the two-sided p-value from the t distribution with n − 1 degrees of freedom. A p-value below the significance level means the population mean differs from μ₀.
A one-sample t-test asks whether the mean of your data differs from an assumed population mean . It is what you use when the standard deviation of the population is unknown and has to be estimated from the sample, which is nearly always.
This follows the t distribution with degrees of freedom. The fewer the degrees of freedom, the heavier the tails of that distribution and the larger the critical value.
With the defaults, the data 12, 15, 18, 20, 25 against an assumed mean of . The sample mean is 18 and the sample variance is 24.5, so the sample standard deviation is .
On degrees of freedom the two-sided p-value is 0.2468. The critical value at a 5% significance level is 2.7764, and does not reach it. The p-value is above 0.05, so the population mean cannot be said to differ from 15.
The p-value is the probability of a mean straying this far from if the population mean really were . When it falls below the significance level, usually 5%, chance becomes an uncomfortable explanation and you conclude that the mean differs.
A large p-value means you have failed to show a difference, not that there is none. With little data, a real difference can easily go unnoticed.
This is a two-sided test: it asks whether the mean differs, in either direction. For a one-sided question, halve the p-value.
At least two values are needed, and they must not all be identical. With no spread, and is undefined.