Overview
A one-sample t-test checks whether a sample's mean differs from a hypothesized value, when the population standard deviation is unknown.
Enter the sample mean, the hypothesized mean, the sample standard deviation and the sample size.
Worked examples
| Inputs | Result |
|---|---|
| Sample Mean54.2Hypothesized Population Mean50Sample Standard Deviation12Sample Size (n)36 | t statistic: 2.1Degrees of freedom: 35Two-tailed p-value: 0.04Reject H0 at 5% level |
Show 2 more examples
| Sample Mean102Hypothesized Population Mean100Sample Standard Deviation10Sample Size (n)50 | t statistic: 1.41Degrees of freedom: 49Two-tailed p-value: 0.16Fail to reject H0 at 5% level |
| Sample Mean9.6Hypothesized Population Mean10Sample Standard Deviation1.2Sample Size (n)15 | t statistic: -1.29Degrees of freedom: 14Two-tailed p-value: 0.22Fail to reject H0 at 5% level |
t statistic by sample mean
With the calculator's starting values, the t statistic is 2.1. The table shows how it changes with the sample mean.
| Sample Mean | t statistic |
|---|---|
| 30 | -10 |
| 40 | -5 |
| 50 | 0 |
| 54.2starting value | 2.1 |
| 60 | 5 |
| 70 | 10 |
| 80 | 15 |
Other inputs: Hypothesized Population Mean: 50 · Sample Standard Deviation: 12 · Sample Size: 36 n. Change them in the calculator above for your own numbers.
How it works
t is the difference between the means divided by the standard error, s ÷ √n, with n − 1 degrees of freedom. The p-value comes from the t distribution, and the decision uses a 5% level.
The formula
Practical tips
- A mean of 54.2 against 50, with s = 12 and n = 36, gives t = 2.1 and a two-tailed p of about 0.043.
- You can check it in Excel with =T.DIST.2T(ABS(t), n − 1).
- For two separate groups, use a two-sample t-test instead.
Frequently asked questions
When should I use a t-test instead of a z-test?
When the population standard deviation is unknown and estimated from the sample.
What are the assumptions?
Independent observations and roughly normal data, or a reasonably large sample.
Is it one- or two-tailed?
The p-value shown is two-tailed. Halve it for a one-tailed test in the expected direction.