What is a hypothesis test for a mean?
It is a procedure to decide whether a sample mean is compatible with an assumed value (H₀). Use the Z test when the population standard deviation is known and the Student t test when you estimate it from the sample.
How to use the calculator
- Choose the test: Student t (most common) or Z.
- Enter your sample mean and the mean under H₀.
- Enter the standard deviation and the sample size.
- Pick the significance level α and read the p-value and conclusion.
Test statistic formula
t = (x̄ − μ₀) / (s / √n) p = P(|T| ≥ |t|)
The test is two-sided. The Student t test uses n − 1 degrees of freedom. If p < α, reject H₀.
Example
With a sample mean of 52.1, H₀: μ = 50, s = 5 and n = 25, the t statistic is 2.1 with 24 degrees of freedom. The p-value is below 0.05, so H₀ is rejected at the 5% level.
Frequently asked questions
What does the p-value mean?
It is the probability of a result at least as extreme as the one observed if H₀ were true. It is not the probability that H₀ is true.
When do I use Z vs. t?
Use Z if you know the population standard deviation. If you computed it from your sample, use the Student t test.
Does rejecting H₀ prove my hypothesis?
No. It shows statistical evidence against H₀, but it does not measure practical importance or prove causation.