Statistics & probability
One-sample t test
Compare a numeric sample mean with a supplied reference value.
A clear answer. Here’s how.
t=(sample mean−reference)/(s/√n), with n−1 degrees of freedom and your chosen alternative. Requires at least two values and positive sample variability. Assumes independent observations and a suitable normal/large-sample model. Reports a numerical p-value; it does not measure effect importance or prove the null hypothesis.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Values, separated by commas or new lines
- 2, 4, 4, 4, 5, 5, 7, 9
- Null-hypothesis mean
- 5
- Alternative hypothesis
- Different (two-sided)
Example result
- Sample mean
- 5
- Observations / pairs
- 8
- t statistic
- 0
- Degrees of freedom
- 7
- p-value
- 1
A p-value is conditional on the stated null model and sampling assumptions; it is not the probability that the null hypothesis is true.